Trying to load a project with Sdk.WindowDesktop fails.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- build-system
Research direction
Start with Microsoft.Build.Evaluation.Project and Microsoft.Build.Locator.MSBuildLocator.RegisterDefaults(), comparing the selected MSBuildPath under Net472 and NetCoreApp31. Reproduce the MSB4236 failure with Microsoft.NET.Sdk.WindowsDesktop and determine what allows the NetCoreApp host to load the SDK project successfully.
Written by the indexing model from the issue text.
Description
I've been trying to load a csproj using new Microsoft.Build.Evaluation.Project("project.csproj", null, null"); and it throws this exception:
The specified SDK "Microsoft.NET.Sdk.WindowsDesktop" could not be found.
Source: Microsoft.Build
Error: MSB4236
MSBuild.CouldNotResolveSdk
The loaded csproj looks like this:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>net471</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>
</Project>
And the host application registers the MSBuild location with:
Microsoft.Build.Locator.MSBuildLocator.RegisterDefaults();
I've noticed different behavior depending on whether the host application is compiled against Net472 or against NetCoreApp31:
On Net472
- The
Microsoft.NET.Sdk.WindowsDesktopprojects succeeds to load. MSBuildPathof Locator Instance points to: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
On NetCoreApp3.1
- The
Microsoft.NET.Sdk.WindowsDesktopprojects throw an exception on load. MSBuildPathof Locator instance points to: "C:\Program Files\dotnet\sdk\2.2.300"
On Net4xx:
So I believe this is the reason because it works on Net4 and not on NetCore.
Is there a way to solve this issue and make the "Microsoft.NET.Sdk.WindowsDesktop" projects to load while the host app is NetCoreApp?
- Dominant language
- C#
- Stars
- 262
- Forks
- 91
- Avg merge
- 11d 22h
- Merged PRs (30d)
- 3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/MSBuildLocator
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
microsoft/MSBuildLocator#390 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 64/100
microsoft/MSBuildLocator#389 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
microsoft/MSBuildLocator#380 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
microsoft/MSBuildLocator#377 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
microsoft/MSBuildLocator#371 · 1 comment ·
All issues in microsoft/MSBuildLocator
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·