未验证 提交 20e48dff 编写于 作者: T Tomáš Matoušek 提交者: GitHub

Use Microsoft.NetFramework.ReferenceAssemblies (#29827)

上级 eb489b72
......@@ -103,17 +103,19 @@
</Choose>
<!--
If TargetNetFX20 is true the project targets Framework 2.0 reference assemblies provided by Microsoft.NetFX20 nuget package.
If the project targets Framework 2.0 reference assemblies provided by Microsoft.NetFramework.ReferenceAssemblies nuget package.
Use the latest Framework toolset to build, but set msbuild properties below
so to avoid 4.5 specific artifacts to be added to the compilation (references, attributes).
-->
<PropertyGroup Condition="'$(TargetNetFX20)' == 'true'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net20'">
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
<NoStdLib>true</NoStdLib>
<FrameworkPathOverride>$(NuGetPackageRoot)\Microsoft.NetFX20\$(MicrosoftNetFX20Version)\lib\net20</FrameworkPathOverride>
<ExecuteAsTool>false</ExecuteAsTool>
<GenerateResourceMSBuildRuntime>CurrentRuntime</GenerateResourceMSBuildRuntime>
<!-- Bypass a check in msbuild that .NET Framework 3.5 is installed on the machine when targeting .NET < 4.0 -->
<BypassFrameworkInstallChecks>true</BypassFrameworkInstallChecks>
</PropertyGroup>
</Project>
......
......@@ -21,7 +21,7 @@
<PackageOutputPath Condition="'$(IsVisualStudioInsertionPackage)' == 'true'">$(ArtifactsConfigurationDir)DevDivPackages\Roslyn\</PackageOutputPath>
</PropertyGroup>
<ItemGroup Condition="'$(Language)' == 'CSharp' and '$(TargetNetFX20)' == 'true'">
<ItemGroup Condition="'$(Language)' == 'CSharp' and '$(TargetFramework)' == 'net20'">
<_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" />
</ItemGroup>
......
......@@ -78,7 +78,7 @@
<MicrosoftNETCorePortableCompatibilityVersion>1.0.1</MicrosoftNETCorePortableCompatibilityVersion>
<MicrosoftNETCoreRuntimeCoreCLRVersion>2.0.0</MicrosoftNETCoreRuntimeCoreCLRVersion>
<MicrosoftNETCoreTestHostVersion>1.1.0</MicrosoftNETCoreTestHostVersion>
<MicrosoftNetFX20Version>1.0.3</MicrosoftNetFX20Version>
<MicrosoftNetFrameworkReferenceAssembliesVersion>1.0.0-alpha-004</MicrosoftNetFrameworkReferenceAssembliesVersion>
<MicrosoftNetSdkVersion>2.0.0-alpha-20170405-2</MicrosoftNetSdkVersion>
<MicrosoftNuGetBuildTasksVersion>0.1.0</MicrosoftNuGetBuildTasksVersion>
<MicrosoftPortableTargetsVersion>0.1.2-dev</MicrosoftPortableTargetsVersion>
......@@ -330,6 +330,7 @@
<UsingToolSymbolUploader>true</UsingToolSymbolUploader>
<UsingToolNuGetRepack>true</UsingToolNuGetRepack>
<UsingToolVSSDK>true</UsingToolVSSDK>
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
</PropertyGroup>
<PropertyGroup>
......
......@@ -144,4 +144,11 @@
</PropertyGroup>
</When>
</Choose>
<!--
Implements proposal https://github.com/dotnet/designs/pull/33.
-->
<ItemGroup Condition="'$(UsingToolNetFrameworkReferenceAssemblies)' == 'true'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="$(MicrosoftNetFrameworkReferenceAssembliesVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
</ItemGroup>
</Project>
......@@ -39,14 +39,26 @@
polluting the output dir. Avoid creating these directories.
https://github.com/dotnet/sdk/issues/1367
WPF temp-projects do not import .props and .targets files from NuGet packages.
(see https://github.com/dotnet/sourcelink/issues/91)
WPF temp-projects do not import .props and .targets files from NuGet packages.
(see https://github.com/dotnet/sourcelink/issues/91).
This breaks SourceLink and Microsoft.NetFramework.ReferenceAssemblies.
-->
<PropertyGroup Condition="'$(IsWpfTempProject)' == 'true'">
<OutDir/>
<DeterministicSourcePaths>false</DeterministicSourcePaths>
</PropertyGroup>
<PropertyGroup Condition="'$(IsWpfTempProject)' == 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(UsingToolNetFrameworkReferenceAssemblies)' == 'true'">
<TargetFrameworkRootPath>$(NuGetPackageRoot)microsoft.netframework.referenceassemblies.$(TargetFramework)\$(MicrosoftNetFrameworkReferenceAssembliesVersion)\build</TargetFrameworkRootPath>
<EnableFrameworkPathOverride>false</EnableFrameworkPathOverride>
<NoStdLib>true</NoStdLib>
</PropertyGroup>
<ItemGroup Condition="'$(IsWpfTempProject)' == 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework'">
<Reference Include="mscorlib" Pack="false" />
</ItemGroup>
<!--
Workaround for a race condition https://github.com/Microsoft/msbuild/issues/1479.
-->
......
......@@ -153,7 +153,7 @@
<Import Include="System.Collections.Generic" />
<Import Include="System.Diagnostics" />
</ItemGroup>
<ItemGroup Condition="'$(TargetNetFX20)' != 'true'">
<ItemGroup Condition="'$(TargetFramework)' != 'net20'">
<Import Include="System.Linq" />
</ItemGroup>
<PropertyGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetNetFX20>true</TargetNetFX20>
</PropertyGroup>
<PropertyGroup>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<PlatformTarget>AnyCPU</PlatformTarget>
......@@ -38,7 +35,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata" Version="$(MicrosoftVisualStudioDebuggerMetadataVersion)" />
<PackageReference Include="Microsoft.NetFX20" Version="$(MicrosoftNetFX20Version)" />
</ItemGroup>
<Import Project="..\CSharpResultProvider.projitems" Label="Shared" />
<Import Project="..\..\..\..\..\..\build\Targets\Vsdconfig.targets" />
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetNetFX20>true</TargetNetFX20>
</PropertyGroup>
<PropertyGroup>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<PlatformTarget>AnyCPU</PlatformTarget>
......@@ -88,7 +85,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata" Version="$(MicrosoftVisualStudioDebuggerMetadataVersion)" />
<PackageReference Include="Microsoft.NetFX20" Version="$(MicrosoftNetFX20Version)" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider" />
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetNetFX20>true</TargetNetFX20>
</PropertyGroup>
<PropertyGroup>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<PlatformTarget>AnyCPU</PlatformTarget>
......@@ -41,7 +38,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata" Version="$(MicrosoftVisualStudioDebuggerMetadataVersion)" />
<PackageReference Include="Microsoft.NetFX20" Version="$(MicrosoftNetFX20Version)" />
</ItemGroup>
<ItemGroup>
<Folder Include="My Project\" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册