I have a VS 2013 console application that downloads any solution file (.sln) - compiles all projects in it using Roslyn and extracts information about using the API from the compilation model.
Now I am facing this unusual problem. When I run the application from Visual Studio 2013 (using Ctrl-F5 or F5), everything works fine. I can compile the material and extract all the information. However, when I open a command prompt (cmd) and try to run this console application, I get the following error:
Unhandled Exception: System.AggregateException: One or more errors occurred. ---> Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project " C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Impor When I run
Pay attention to v14.0 . Why is MSBuildWorkspace trying to find the v14.0 directory for the required destination files? Is this because I installed MSBuild for CTP and changed the default path when I ran the material from a simple command line?
- Edit-- Here is the import
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
However, I doubt that this is due to the Import statement as such. If I run the .exe console application from the "Developer Command Prompt for Visual Studio 2013", everything works fine again.
source share