Open pakrym opened 6 years ago
@peterhuene please take a look.
This is fundamentally the same issue as #1834, but for UseAppHost
instead of SelfContained
. The general problem is our reliance on global properties and how they will ultimately interact with P2P references and, in cases like RuntimeIdentifier
and SelfContained
, can alter what is restored against.
There should be no reason to set a global UseAppHost
property; in 2.2, setting SelfContained
to false is the preferred mechanism since UseAppHost
defaults to true. Still, setting a global SelfContained
property can cause problems for P2P references between Exe
output type projects as well (see previously mentioned issue).
Repro:
lib2/lib2.csproj
lib1/lib1.csproj
dotnet publish /p:UseAppHost=true /p:RuntimeIdentifier=win7-x64
inlib1
directory.Expected:
Publish succedes
Actual:
C:\Users\pakrymet\.dotnet\x64\sdk\2.1.400\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(119,5): error NETSDK1066: A RuntimeIdentifier must be specified to publish a framework-dependent application with an application host. [D:\temp\888\lib2\lib2.csproj]
Suspect
Microsoft.Common.CurrentVersion.targets
includesTargetFramework;RuntimeIdentifier
inRemoveProperties
but notUseAppHost