mac/linux `dotnet build` 找不到框架“.NETFramework..”的参考程序集
mac/linux `dotnet build` The reference assemblies for framework ".NETFramework.." were not found
当尝试构建面向 net47 而不是 .netcore 或 .net std 的 Microsoft.NET.Sdk 风格的项目时。 dotnet build
将给出有关缺少目标包的错误。 msbuild 可以代替,但我更愿意使用 dotnet build
。有办法吗
/usr/local/share/dotnet/sdk/2.1.200/Microsoft.Common.CurrentVersion.targets
(1179,5): error MSB3644: The reference assemblies for framework
".NETFramework,Version=v4.7" were not found. To resolve this, install the
SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or
Targeting Pack installed. Note that assemblies will be resolved from the
Global Assembly Cache (GAC) and will be used in place of reference
assemblies. Therefore your assembly may not be correctly targeted for the
framework you intend.
是的。可以使用 nuget 提取目标包。然后添加框架路径覆盖。如果您的目标框架是 .NET v4.7
,那么这里有一个片段可以添加到 Microsoft.NET.Sdk.csproj/.fsproj 的任何位置
<PropertyGroup Condition="'$(OS)' != 'Windows_NT' AND '$(TargetFramework)'== 'net47'">
<!-- Make .NET 4.7 reference assemblies available even on Linux -->
<FrameworkPathOverride>$(NuGetPackageRoot)microsoft.targetingpack.netframework.v4.7/1.0.1/lib/net47/</FrameworkPathOverride>
<!-- Make sure the additional feed is searched. -->
<RestoreAdditionalProjectSources>https://dotnet.myget.org/F/dotnet-core/api/v3/index.json</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup Condition="'$(OS)' != 'Windows_NT' AND '$(TargetFramework)'== 'net47'">
<!-- Make sure the reference assemblies are available -->
<PackageReference Include="Microsoft.TargetingPack.NETFramework.v4.7"
Version="1.0.1" ExcludeAssets="All" PrivateAssets="All" />
</ItemGroup>
我们在非 Windows
上构建 .NET Framework 4.7.2 的解决方案
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<ItemGroup Condition="'$(OS)' != 'Windows_NT'">
<PackageReference Include="NuGet.Frameworks" Version="4.7.2" />
</ItemGroup>
</Project>
有解决方案不需要依赖MyGet;添加此道具导入:
<TargetFramework>net472</TargetFramework>
<OutDir>bin</OutDir>
</PropertyGroup>
+<Import Project="netfx.props" />
<ItemGroup>
然后在您的解决方案中包含此 netfx.props
文件:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- When compiling .NET SDK 2.0 projects targeting .NET 4.x on Mono using 'dotnet build' you -->
<!-- have to teach MSBuild where the Mono copy of the reference asssemblies is -->
<TargetIsMono Condition="($(TargetFramework.StartsWith('net4')) OR $(TargetFrameworkVersion.StartsWith('v4.'))) AND '$(OS)' == 'Unix'">true</TargetIsMono>
<!-- Look in the standard install locations -->
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/lib/mono')">/usr/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/local/lib/mono')">/usr/local/lib/mono</BaseFrameworkPathOverrideForMono>
<!-- If we found Mono reference assemblies, then use them -->
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net45' OR '$(TargetFrameworkVersion)' == 'v4.5')">$(BaseFrameworkPathOverrideForMono)/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net451' OR '$(TargetFrameworkVersion)' == 'v4.5.1')">$(BaseFrameworkPathOverrideForMono)/4.5.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net452' OR '$(TargetFrameworkVersion)' == 'v4.5.2')">$(BaseFrameworkPathOverrideForMono)/4.5.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net46' OR '$(TargetFrameworkVersion)' == 'v4.6')">$(BaseFrameworkPathOverrideForMono)/4.6-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net461' OR '$(TargetFrameworkVersion)' == 'v4.6.1')">$(BaseFrameworkPathOverrideForMono)/4.6.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net462' OR '$(TargetFrameworkVersion)' == 'v4.6.2')">$(BaseFrameworkPathOverrideForMono)/4.6.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net47' OR '$(TargetFrameworkVersion)' == 'v4.7')">$(BaseFrameworkPathOverrideForMono)/4.7-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net471' OR '$(TargetFrameworkVersion)' == 'v4.7.1')">$(BaseFrameworkPathOverrideForMono)/4.7.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net472' OR '$(TargetFrameworkVersion)' == 'v4.7.2')">$(BaseFrameworkPathOverrideForMono)/4.7.2-api</FrameworkPathOverride>
<EnableFrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">true</EnableFrameworkPathOverride>
<!-- Add the Facades directory. Not sure how else to do this. Necessary at least for .NET 4.5 -->
<AssemblySearchPaths Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">$(FrameworkPathOverride)/Facades;$(AssemblySearchPaths)</AssemblySearchPaths>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)'== 'net472' OR '$(TargetFrameworkVersion)' == 'v4.7.2'">
<Reference Include="netstandard" />
</ItemGroup>
</Project>
(基于 this。)
@knocte 的回答对我有用,但我不得不删除这一行。
<AssemblySearchPaths Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">$(FrameworkPathOverride)/Facades;$(AssemblySearchPaths)</AssemblySearchPaths>
全文是。
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- When compiling .NET SDK 2.0 projects targeting .NET 4.x on Mono using 'dotnet build' you -->
<!-- have to teach MSBuild where the Mono copy of the reference asssemblies is -->
<TargetIsMono Condition="($(TargetFramework.StartsWith('net4')) OR $(TargetFrameworkVersion.StartsWith('v4.'))) AND '$(OS)' == 'Unix'">true</TargetIsMono>
<!-- Look in the standard install locations -->
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/lib/mono')">/usr/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/local/lib/mono')">/usr/local/lib/mono</BaseFrameworkPathOverrideForMono>
<!-- If we found Mono reference assemblies, then use them -->
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net45' OR '$(TargetFrameworkVersion)' == 'v4.5')">$(BaseFrameworkPathOverrideForMono)/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net451' OR '$(TargetFrameworkVersion)' == 'v4.5.1')">$(BaseFrameworkPathOverrideForMono)/4.5.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net452' OR '$(TargetFrameworkVersion)' == 'v4.5.2')">$(BaseFrameworkPathOverrideForMono)/4.5.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net46' OR '$(TargetFrameworkVersion)' == 'v4.6')">$(BaseFrameworkPathOverrideForMono)/4.6-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net461' OR '$(TargetFrameworkVersion)' == 'v4.6.1')">$(BaseFrameworkPathOverrideForMono)/4.6.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net462' OR '$(TargetFrameworkVersion)' == 'v4.6.2')">$(BaseFrameworkPathOverrideForMono)/4.6.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net47' OR '$(TargetFrameworkVersion)' == 'v4.7')">$(BaseFrameworkPathOverrideForMono)/4.7-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net471' OR '$(TargetFrameworkVersion)' == 'v4.7.1')">$(BaseFrameworkPathOverrideForMono)/4.7.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net472' OR '$(TargetFrameworkVersion)' == 'v4.7.2')">$(BaseFrameworkPathOverrideForMono)/4.7.2-api</FrameworkPathOverride>
<EnableFrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">true</EnableFrameworkPathOverride>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)'== 'net472' OR '$(TargetFrameworkVersion)' == 'v4.7.2'">
<Reference Include="netstandard" />
</ItemGroup>
</Project>
我正在使用 MAC OS
当尝试构建面向 net47 而不是 .netcore 或 .net std 的 Microsoft.NET.Sdk 风格的项目时。 dotnet build
将给出有关缺少目标包的错误。 msbuild 可以代替,但我更愿意使用 dotnet build
。有办法吗
/usr/local/share/dotnet/sdk/2.1.200/Microsoft.Common.CurrentVersion.targets
(1179,5): error MSB3644: The reference assemblies for framework
".NETFramework,Version=v4.7" were not found. To resolve this, install the
SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or
Targeting Pack installed. Note that assemblies will be resolved from the
Global Assembly Cache (GAC) and will be used in place of reference
assemblies. Therefore your assembly may not be correctly targeted for the
framework you intend.
是的。可以使用 nuget 提取目标包。然后添加框架路径覆盖。如果您的目标框架是 .NET v4.7
,那么这里有一个片段可以添加到 Microsoft.NET.Sdk.csproj/.fsproj 的任何位置 <PropertyGroup Condition="'$(OS)' != 'Windows_NT' AND '$(TargetFramework)'== 'net47'">
<!-- Make .NET 4.7 reference assemblies available even on Linux -->
<FrameworkPathOverride>$(NuGetPackageRoot)microsoft.targetingpack.netframework.v4.7/1.0.1/lib/net47/</FrameworkPathOverride>
<!-- Make sure the additional feed is searched. -->
<RestoreAdditionalProjectSources>https://dotnet.myget.org/F/dotnet-core/api/v3/index.json</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup Condition="'$(OS)' != 'Windows_NT' AND '$(TargetFramework)'== 'net47'">
<!-- Make sure the reference assemblies are available -->
<PackageReference Include="Microsoft.TargetingPack.NETFramework.v4.7"
Version="1.0.1" ExcludeAssets="All" PrivateAssets="All" />
</ItemGroup>
我们在非 Windows
上构建 .NET Framework 4.7.2 的解决方案<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<ItemGroup Condition="'$(OS)' != 'Windows_NT'">
<PackageReference Include="NuGet.Frameworks" Version="4.7.2" />
</ItemGroup>
</Project>
有解决方案不需要依赖MyGet;添加此道具导入:
<TargetFramework>net472</TargetFramework>
<OutDir>bin</OutDir>
</PropertyGroup>
+<Import Project="netfx.props" />
<ItemGroup>
然后在您的解决方案中包含此 netfx.props
文件:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- When compiling .NET SDK 2.0 projects targeting .NET 4.x on Mono using 'dotnet build' you -->
<!-- have to teach MSBuild where the Mono copy of the reference asssemblies is -->
<TargetIsMono Condition="($(TargetFramework.StartsWith('net4')) OR $(TargetFrameworkVersion.StartsWith('v4.'))) AND '$(OS)' == 'Unix'">true</TargetIsMono>
<!-- Look in the standard install locations -->
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/lib/mono')">/usr/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/local/lib/mono')">/usr/local/lib/mono</BaseFrameworkPathOverrideForMono>
<!-- If we found Mono reference assemblies, then use them -->
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net45' OR '$(TargetFrameworkVersion)' == 'v4.5')">$(BaseFrameworkPathOverrideForMono)/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net451' OR '$(TargetFrameworkVersion)' == 'v4.5.1')">$(BaseFrameworkPathOverrideForMono)/4.5.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net452' OR '$(TargetFrameworkVersion)' == 'v4.5.2')">$(BaseFrameworkPathOverrideForMono)/4.5.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net46' OR '$(TargetFrameworkVersion)' == 'v4.6')">$(BaseFrameworkPathOverrideForMono)/4.6-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net461' OR '$(TargetFrameworkVersion)' == 'v4.6.1')">$(BaseFrameworkPathOverrideForMono)/4.6.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net462' OR '$(TargetFrameworkVersion)' == 'v4.6.2')">$(BaseFrameworkPathOverrideForMono)/4.6.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net47' OR '$(TargetFrameworkVersion)' == 'v4.7')">$(BaseFrameworkPathOverrideForMono)/4.7-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net471' OR '$(TargetFrameworkVersion)' == 'v4.7.1')">$(BaseFrameworkPathOverrideForMono)/4.7.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net472' OR '$(TargetFrameworkVersion)' == 'v4.7.2')">$(BaseFrameworkPathOverrideForMono)/4.7.2-api</FrameworkPathOverride>
<EnableFrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">true</EnableFrameworkPathOverride>
<!-- Add the Facades directory. Not sure how else to do this. Necessary at least for .NET 4.5 -->
<AssemblySearchPaths Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">$(FrameworkPathOverride)/Facades;$(AssemblySearchPaths)</AssemblySearchPaths>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)'== 'net472' OR '$(TargetFrameworkVersion)' == 'v4.7.2'">
<Reference Include="netstandard" />
</ItemGroup>
</Project>
(基于 this。)
@knocte 的回答对我有用,但我不得不删除这一行。
<AssemblySearchPaths Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">$(FrameworkPathOverride)/Facades;$(AssemblySearchPaths)</AssemblySearchPaths>
全文是。
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- When compiling .NET SDK 2.0 projects targeting .NET 4.x on Mono using 'dotnet build' you -->
<!-- have to teach MSBuild where the Mono copy of the reference asssemblies is -->
<TargetIsMono Condition="($(TargetFramework.StartsWith('net4')) OR $(TargetFrameworkVersion.StartsWith('v4.'))) AND '$(OS)' == 'Unix'">true</TargetIsMono>
<!-- Look in the standard install locations -->
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/lib/mono')">/usr/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/local/lib/mono')">/usr/local/lib/mono</BaseFrameworkPathOverrideForMono>
<!-- If we found Mono reference assemblies, then use them -->
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net45' OR '$(TargetFrameworkVersion)' == 'v4.5')">$(BaseFrameworkPathOverrideForMono)/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net451' OR '$(TargetFrameworkVersion)' == 'v4.5.1')">$(BaseFrameworkPathOverrideForMono)/4.5.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net452' OR '$(TargetFrameworkVersion)' == 'v4.5.2')">$(BaseFrameworkPathOverrideForMono)/4.5.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net46' OR '$(TargetFrameworkVersion)' == 'v4.6')">$(BaseFrameworkPathOverrideForMono)/4.6-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net461' OR '$(TargetFrameworkVersion)' == 'v4.6.1')">$(BaseFrameworkPathOverrideForMono)/4.6.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net462' OR '$(TargetFrameworkVersion)' == 'v4.6.2')">$(BaseFrameworkPathOverrideForMono)/4.6.2-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net47' OR '$(TargetFrameworkVersion)' == 'v4.7')">$(BaseFrameworkPathOverrideForMono)/4.7-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net471' OR '$(TargetFrameworkVersion)' == 'v4.7.1')">$(BaseFrameworkPathOverrideForMono)/4.7.1-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND ('$(TargetFramework)' == 'net472' OR '$(TargetFrameworkVersion)' == 'v4.7.2')">$(BaseFrameworkPathOverrideForMono)/4.7.2-api</FrameworkPathOverride>
<EnableFrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">true</EnableFrameworkPathOverride>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)'== 'net472' OR '$(TargetFrameworkVersion)' == 'v4.7.2'">
<Reference Include="netstandard" />
</ItemGroup>
</Project>
我正在使用 MAC OS