Could Not Load File Or Assembly

After upgrading from Visual Studio 2015 to Visual Studio 2017 Professional we are getting this error in the code behind #error Generation error: Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.I am on Visual Studio Professional 2017 15.1 (26403.7) with the following latest stable versions of Specflow with.Net Framework V4.5.1Is there a new release candidate available to fix this? Hi!I have checked on my PC (with only VS2017 installed) and the old version of the TechTalk.SpecFlow.Generator.dll (1.9.0.77) is only on Extension Directory (C:UsersuserAppDataLocalMicrosoftVisualStudio15.0ec7d7fbdExtensionsln5zapk1.fxe).This can not be deleted or substituted (obviously).The 'strange' thing is that I do not always have the problem. And then it happens the solution is:. roll back the feature file (and connected.cs). close VS. open again.

Could not load file or assembly

Could Not Load File Or Assembly 'system.runtime

try to make the same modification99% it works. If it is not functioning a do it again and works.Hope it helps. If anyone has a repro that you can provide, it will help Andi troubleshoot. I tried to reduce my solution to something more manageable so I could send it to him, but as I removed projects, it started working.

It seems as if it's an issue related to either project types being loaded, or the total number (perhaps long load time).As I mentioned earlier, for me it was removing some unknown section in the solution file related to the VSTestHost. Who knows, maybe removing that changed the load time just enough to make it reliable for me. Even when I added that back in, if I removed other projects, it would also work. We can see this because a new project in a new empty solution in VS2017 works just fine.It's all just theory until he can reproduce it.

Its closed source so I cannot just send the whole solution. Is only specflow test project enough?One thing I just noticed, after reinstalling specflow extension.

After opening the solution fresh and Saving a feature that didnt have the.cs file anymore because of the error, it generated the class correctly with:// This code was generated by SpecFlow.// SpecFlow Version:2.1.0.0// SpecFlow Generator Version:2.0.0.0Then I did a build all and I get errors again. Also guess what I get when I save a feature again (or from the build):// This code was generated by SpecFlow.// SpecFlow Version:1.9.0.77// SpecFlow Generator Version:1.9.0.0// Runtime Version:4.0.0. Okay, but that was the only 1.9 version I still had except for some old project dirs with the old version in packages folder.I've been overwriting the 1.9 files in the extension folder with 2.1 version, causing errors in VS, so I moved it back again.

Restarted Visual Studio. Guess what, now its generating the classes correctly again.Weird stuff.

At the moment the only 1.9 dll left on my machine is the one in the extension folder. So I hope I will only get the // SpecFlow Generator Version:2.0.0.0 comments in my feature cs files from now on. That fixed it. I didn't have SpecRun.SpecFlow.2-3-0 installed, so i just installed it, cleared%temp% and restarted VS2017, opened the repo project and was able to regenerate all files in the repo project and in the original project.here are my packages that helped fix it.

Could not load file or assembly visual studio 2017

When executing the tests, i get a license error.Invalid license: License is not valid for this version.I'll contact Specflow+ support for info on the license issue. I managed to reproduce the error in a fresh new project. All it took was to install the SpecFlow nuget package version 2.1.0. Also from ProcMon, it seems to really be searching for files with b03f5f7f11d50a3a in their name it fails to find them.If I use the 2.2.1 version of the nuget package, it works fine.Edit:I found the problem, fromThe root cause of this problem comes from relative paths in the 'devenv.exe.config' file to Microsoft.Build.Framework.dll (see xml tags).Some Visual Studio Extensions are changing the current directory and makes relative paths invalid.To fix it, open this file in the C:Program Files (x86)Microsoft Visual Studio2017EnterpriseCommon7IDE directory. And replace all.MSBuild15.0Bin by C:Program Files (x86)Microsoft Visual Studio2017EnterpriseMSBuild15.0Bin.Putting absolute paths there fixed the issue for me.So it seems that SpecFlow 2.1.0 was changing the current directory, while 2.2.1 wasn't doing that anymore. I'm experiencing this issue as well, and I'm using the latest of everything as of 20-AUG-2018.I believe in my case it is due to my temp folder having a backslash at the end of it.