Closed carlossanlop closed 1 year ago
From @carlossanlop on Wednesday, July 31, 2019 6:26:00 PM
@livarcocc @nguerrera is this something your team should look into?
From @livarcocc on Wednesday, July 31, 2019 7:13:17 PM
That target is not support by the .NET Core SDK. It ships with VS and is used for old style web projects.
To use that, you need to use full framework msbuild (msbuild.exe).
From @nguerrera on Wednesday, July 31, 2019 7:27:57 PM
This uses MSBuildLocator.RegisterDefaults()
You would need the locator to pick a Visual Studio installation, and not a .NET Core SDK installation.
This is maybe better discussed at https://github.com/microsoft/msbuildlocator
cc @rainersigwald
@carlossanlop, is your application that uses Locator a .NET Core or desktop .NET application? Right now they find mutually exclusive installations of MSBuild.
@carlossanlop, is your application that uses Locator a .NET Core or desktop .NET application? Right now they find mutually exclusive installations of MSBuild.
@andez2000 this question is for you.
@rainersigwald I'm not the original poster, I merely transferred it from the dotnet/core repo.
@carlossanlop, is your application that uses Locator a .NET Core or desktop .NET application? Right now they find mutually exclusive installations of MSBuild.
It is a dotnet core application I was trying to get the dotnet projects built from. It would be great if you could have a single runtime to build both. I guess this is not possible?
@andez2000 MSBuild running on .NET Framework (as in Visual Studio) can build all kinds of projects, and MSBuild running on .NET Core can build only .NET Core SDK projects. So you might be able to meet your goals by changing your application to target .NET 4.8 instead of Core.
We have better documentation on this now.
From @andez2000 on Monday, July 15, 2019 9:45:37 PM
Missing targets Microsoft.WebApplication.targets error when using MSBuild and Roslyn to iterate through documents in a web project
This was working for the same dotnet core project I wrote that targets either dotnet2.2 or 3.0 when I had 3.0.100-preview5-011568 installed. Having just installed 3.0.100-preview6-012264, the following error is displayed:
No code changes were made to my project, nor the solution I am loading. The solution I am loading is a dotnet web application targeting
dotnet v4.7.2
.This uses
MSBuildLocator.RegisterDefaults()
to provide the ground work into locating msbuild, where I have the following information output.3.0.100-preview5-011568
3.0.100-preview6-012264
Is it a case of the sdk missing the targets file or something more sinister?
The information listed is from my home PC. My work computer just has the 3.0.100-preview6-012264 installed and not other dotnetcore versions.
In 3.0.100-preview5-011568 the targets file can be found under
C:\Program Files\dotnet\sdk\3.0.100-preview5-011568\Microsoft\VisualStudio\v16.0\WebApplications
. In 3.0.100-preview6-012264 the folderC:\Program Files\dotnet\sdk\3.0.100-preview5-011568\Microsoft\VisualStudio
does not even exist.When preview 6 is installed alongside preview 5, then the build target issue will appear.
Copied from original issue: dotnet/core#3047