Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Sdks\Microsoft.NET.Sdk.Web\Sdk\Sdk.props #20168

Open
abhijitparkhi1983 opened this issue Jun 12, 2017 · 8 comments
Milestone

Comments

@abhijitparkhi1983
Copy link

abhijitparkhi1983 commented Jun 12, 2017

Version Used:
1.3.1 / 2.2.0
Steps to Reproduce:

  1. Download ServiceStack from github (https://github.com/ServiceStack/ServiceStack)
  2. Run following code for all the solutions under ServiceStack source code.
var workspace = MSBuildWorkspace.Create();
Solution  solution = workspace.OpenSolutionAsync(solutionPath).Result;
  1. When the above step is executed, we get following exception for project \ServiceStack-master\src\ServiceStack.Core.SelfHost\ServiceStack.Core.SelfHost.csproj:

Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Sdks\Microsoft.NET.Sdk.Web\Sdk\Sdk.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Environment Details:

  • Windows 7 server Machine.
  • NO Visual Studios 2015/Visual Studios 2017 installed.
  • Visual Studios 2015 Build Tool Installed.
  • Visual Studios 2017 Build Tool Installed (But obviously no Sdk's under the C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild folder because we dont have complete Visual Studios 2017 installed).

Expected Behavior:
The Solution should open successfully. But certainly this case should be handled for deployments on server machine where Visual Studios cannot be installed.

Actual Behavior:
Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Sdks\Microsoft.NET.Sdk.Web\Sdk\Sdk.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

@abhijitparkhi1983 abhijitparkhi1983 changed the title Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" was not found. Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Sdks\Microsoft.NET.Sdk.Web\Sdk\Sdk.props Jun 12, 2017
@Pilchie
Copy link
Member

Pilchie commented Jun 12, 2017

@srivatsn / @livarcocc - does this belong on project system or sdk?

@livarcocc
Copy link

This seems like an issue that should go to the SDK. However, @abhijitparkhi1983, did you install the core workload when installing the 2017 BUILD SKU?

@srivatsn
Copy link
Contributor

Note that the .NET Core workload of BuildTools is only in the 15.3 Preview (not sure if it was in Preview1)

@abhijitparkhi1983
Copy link
Author

@livarcocc ,

When you say core workload, you mean .NET Core. Right ?
No I have not. If I am right, we dont get any option to install it while installing the Visual Studios 2017 Build Tool . Do we have to install .NET Core explicitly on the deployment server for this purpose?

Was also wondering about the relation between SDK and .NET core. Can you please elaborate.

@abhijitparkhi1983
Copy link
Author

@srivatsn ,
I dint get you. The installer details say that the Product Version is 15.0.2640.13.
Can you specify a link to the Visual Studios 2017 Build Tool 15.3 preview version?

@abhijitparkhi1983
Copy link
Author

@Pilchie ,

Is there any document/list which you can share with me which details all the pre-requisites required for opening any solution (under any .net application build on .NET Version 3.5 and above at least) using Roslyn on a Server machine where we dont have any version of Visual Studios installed.

@Pilchie
Copy link
Member

Pilchie commented Jun 13, 2017

@abhijitparkhi1983 No - it depends on exactly what types of projects you want to open. Since MSBuild is an extensible system, any 3rd party can create project types with it's own SDKs etc. There is no way for us to know what all the dependencies of all projects will be.

@abhijitparkhi1983
Copy link
Author

@livarcocc

While installing Visual Studios 2015 Build Tool, i dont get an option for Core Workload. I just have following two options under WorkLoads:

  1. Visual C++ build tools.
  2. Web Development build tools.

I had checked both of them while installing the Build tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants