Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Microsoft.NetFramework.ReferenceAssemblies #29827

Merged
merged 1 commit into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions build/Targets/BeforeCommonTargets.targets
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion build/Targets/Imports.targets
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
3 changes: 2 additions & 1 deletion build/Targets/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we also be deleting the old package we used to use?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting the code that produces that produces that package? I think I already did that before :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I meant deleting the package that brings in the reference assemblies that I created some time ago. That is referenced here and it would seem this supercedes it now: RoslynToolsReferenceAssembliesVersion

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that thing. Yeah, I'll delete that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that thing

that glorious awful hack 😄

<MicrosoftNetSdkVersion>2.0.0-alpha-20170405-2</MicrosoftNetSdkVersion>
<MicrosoftNuGetBuildTasksVersion>0.1.0</MicrosoftNuGetBuildTasksVersion>
<MicrosoftPortableTargetsVersion>0.1.2-dev</MicrosoftPortableTargetsVersion>
Expand Down Expand Up @@ -332,6 +332,7 @@
<UsingToolSymbolUploader>true</UsingToolSymbolUploader>
<UsingToolNuGetRepack>true</UsingToolNuGetRepack>
<UsingToolVSSDK>true</UsingToolVSSDK>
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
</PropertyGroup>

<PropertyGroup>
Expand Down
7 changes: 7 additions & 0 deletions build/Targets/RepoToolset/ProjectDefaults.props
Original file line number Diff line number Diff line change
Expand Up @@ -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>
16 changes: 14 additions & 2 deletions build/Targets/RepoToolset/Workarounds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -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.
-->
Expand Down
2 changes: 1 addition & 1 deletion build/Targets/Settings.props
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?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>
Expand Down Expand Up @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?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>
Expand Down Expand Up @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?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>
Expand Down Expand Up @@ -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\" />
Expand Down