Trying to load a project with Sdk.WindowDesktop fails.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- csharp
- Ambito
- build-system
Direzione di ricerca
Inizia con Microsoft.Build.Evaluation.Project e Microsoft.Build.Locator.MSBuildLocator.RegisterDefaults(), confrontando il MSBuildPath selezionato in Net472 e NetCoreApp31. Riproduci l'errore MSB4236 con Microsoft.NET.Sdk.WindowsDesktop e determina cosa consente all'host NetCoreApp di caricare correttamente il progetto SDK.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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?
- Lingua principale
- C#
- Stelle
- 262
- Fork
- 91
- Merge medio
- 11g 22h
- PR unite (30g)
- 3
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/MSBuildLocator
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
microsoft/MSBuildLocator#390 · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 64/100
microsoft/MSBuildLocator#389 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
microsoft/MSBuildLocator#380 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
microsoft/MSBuildLocator#377 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
microsoft/MSBuildLocator#371 · 1 commento ·
Tutte le issue di microsoft/MSBuildLocator
Issue simili
-
ci-failure-cause test-failure
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
area:frontend bug FE hotspot:css mvp P3
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
klasolsson81/jobbliggaren#1856 ·
-
Area: App+Library Build
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Aaronontheweb/freshdesk-cli#148 ·