Reputation: 1173
Run this code (replace with real *.proj file):
public MainWindow()
{
InitializeComponent();
Loaded += (sender, args) => BuildManager.DefaultBuildManager.Build(new BuildParameters(),
new BuildRequestData(@"e:\Tests\ConsoleApp7\ConsoleApp7\ConsoleApp7.csproj", new Dictionary<string, string>(), null,
new[] { "Build" }, null, BuildRequestDataFlags.ReplaceExistingProjectInstance));
}
It is okay for me now
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'
Inner Exception: FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
What is the best way to resolve it?
Upvotes: 2
Views: 233
Reputation: 51
I am having a very similar issue using Microsoft.Web.Administration 10.0.0 (latest at time of writing) within a WiX installer project. I've been having this issue only after I have updated from VisualStudio 2017 15.2 to 15.4, so I am not entirely sure this is exactly the same problem you are experiencing, but the exception is the same.
Unfortunately my solution has been to downgrade to Microsoft.Web.Administration 7.0.0. I have contacted the owner of the nuget package and I am awaiting a better explanation from them, however I hope this might help you for the moment!
Upvotes: 1