Skip to content

Can't install with dotnet SDK 1.X; 2.X can't install some sample projects #458

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

Closed
JoshuaKGoldberg opened this issue Nov 4, 2017 · 5 comments

Comments

@JoshuaKGoldberg
Copy link
Contributor

When I try to use dotnet restore with a 1.X SDK install, a dotnet restore error: Invalid input 'src\React.sln'. The file type was not recognized. pops up as part of dev-build.bat.

When I uninstall that and use a 2.X install, dotnet restore src\React.sln etc. fails with The specified SDK version [1.0.0] from global.json [C:\Code\React.NET\global.json] not found; install specified SDK version.

When I change global.json to reference "version": "2.0.0" instead of "version": "1.0.0", it complains about a trio of missing targets in sample projects, then installs the rest:

C:\Code\React.NET\src\React.Sample.Mvc4\React.Sample.Mvc4.csproj(198,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.0.2\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
C:\Code\React.NET\src\React.Sample.Cassette\React.Sample.Cassette.csproj(204,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.0.2\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
C:\Code\React.NET\src\React.Sample.Webpack\React.Sample.Webpack.csproj(181,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.0.2\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
C:\Code\React.NET\src\React.Sample.Mvc4\React.Sample.Mvc4.csproj : warning NU1503: Skipping restore for project 'C:\Code\React.NET\src\React.Sample.Mvc4\React.Sample.Mvc4.csproj'. The project file may be invalid or missing targets required for restore. [C:\Code\React.NET\src\React.sln]
C:\Code\React.NET\src\React.Sample.Cassette\React.Sample.Cassette.csproj : warning NU1503: Skipping restore for project 'C:\Code\React.NET\src\React.Sample.Cassette\React.Sample.Cassette.csproj'. The project file may be invalid or missing targets required for restore. [C:\Code\React.NET\src\React.sln]
C:\Code\React.NET\src\React.Sample.Webpack\React.Sample.Webpack.csproj : warning NU1503: Skipping restore for project 'C:\Code\React.NET\src\React.Sample.Webpack\React.Sample.Webpack.csproj'. The project file may be invalid or missing targets required for restore. [C:\Code\React.NET\src\React.sln]

I'm guessing there's some part of the VS/dotnet install I'm missing?

@JoshuaKGoldberg
Copy link
Contributor Author

Note: to get the rest of the installs running in the PackageRestore task, I commented out the dotnet restores in build.proj:

	<Target Name="RestorePackages" DependsOnTargets="Clean;UpdateVersion">
		<!-- NuGet packages for "legacy" projects (eg. React.Samples.Mvc4) -->
		<!-- <Exec
			WorkingDirectory="$(MSBuildProjectDirectory)"
			Command="tools\NuGet\nuget.exe restore $(SolutionFile)"
		/> -->
		<!-- NuGet packages for modern .csproj projects -->
		<!-- <Exec
			WorkingDirectory="$(MSBuildProjectDirectory)"
			Command="dotnet restore $(SolutionFile) /p:Version=$(VersionString)"
		/> -->

@JoshuaKGoldberg
Copy link
Contributor Author

The imported project
"C:\Program Files\dotnet\sdk\2.0.2\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" 
was not found

This actually exists in two locations on my machine:

  • "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets"
  • "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets"

@Daniel15
Copy link
Member

Daniel15 commented Nov 4, 2017

The project hasn't been updated to the .NET Core 2.0 SDK yet. It currently uses 1.1

There's a pull request to upgrade it to 2.0: #436. I might work on completing that PR and merge it, which should resolve some issues here.

@Daniel15
Copy link
Member

Daniel15 commented Nov 4, 2017

C:\Code\React.NET\src\React.Sample.Mvc4\React.Sample.Mvc4.csproj(198,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.0.2\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

This is the same issue I'm hitting while trying to get #436 working. It looks like the same issue as dotnet/sdk#1385.

@Daniel15
Copy link
Member

Daniel15 commented Nov 4, 2017

dd4e504 should fix the issue with Microsoft.WebApplication.targets. Unfortunately I had to hard-code the path, as MSBuildExtensionsPath32 now points to the .NET Core directory rather than the MSBuild extensions directory.

@Daniel15 Daniel15 closed this as completed Nov 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants