Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Remove reference assemblies from NetFx netstandard support package
Browse files Browse the repository at this point in the history
Multiple tools in .NETFramework projects are attempting to load references
for execution which fails for reference assemblies.

To work better with these tools, don't use reference assemblies in the support
package.
  • Loading branch information
ericstj committed Aug 31, 2017
1 parent 135f20d commit fbdc453
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 41 deletions.
1 change: 0 additions & 1 deletion dir.targets
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
</BinPlaceConfiguration>
<BinPlaceConfiguration Condition="('$(IsNetFxNETStandard)' == 'true' OR '$(IsNetFxNETStandardRef)' == 'true') AND '$(BuildingNETFxVertical)' == 'true'"
Include="netfx-$(_bc_OSGroup);net462-$(_bc_OSGroup);net47-$(_bc_OSGroup)">
<PackageFileRefPath Condition="'$(IsNetFxNETStandardRef)'=='true'">$(NetFxPackageRefPath)</PackageFileRefPath>
<PackageFileRuntimePath Condition="'$(IsNetFxNETStandard)'=='true'">$(NetFxPackageRuntimePath)</PackageFileRuntimePath>
</BinPlaceConfiguration>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<LibBinDir>$(NetFxPackageRuntimePath)</LibBinDir>

<IsFrameworkPackage>true</IsFrameworkPackage>
<IncludeReferenceFiles>false</IncludeReferenceFiles>
<IncludeLibFiles>true</IncludeLibFiles>

<!-- ValidatePackage doesn't evaluate our targets/props so it does
Expand Down Expand Up @@ -41,24 +42,19 @@

<Target Name="IncludeNETStandardShims">
<ItemGroup>
<_refFileNames Include="@(RefFile->'%(FileName)')" Condition="'%(Extension)' == '.dll'" />
<_libFileNames Include="@(LibFile->'%(FileName)')" Condition="'%(Extension)' == '.dll'" />

<!-- remove any targeting pack assemblies that we build ourselves -->
<_netFxReference Include="@(NetFxReference)" Exclude="@(_refFileNames);@(_libFileNames)" />
<_netFxReference Include="@(NetFxReference)" Exclude="@(_libFileNames)" />

<!-- ignore any assemblies we expect to come from the targeting pack -->
<IgnoredReference Include="@(_netFxReference)" />
<SuppressNETStandardMissingFile Include="@(_netFxReference)" />

<!-- don't include shims for anything from the targeting pack or built explicitly -->
<_excludeShimsRef Include="@(_netFxReference);@(_refFileNames)"/>
<_excludeShimsLib Include="@(_netFxReference);@(_libFileNames)"/>

<!-- fill in with netstandard.dll-based shims -->
<RefFile Include="$(NETStandardPackageRefPath)\*.dll" Exclude="@(_excludeShimsRef->'$(NETStandardPackageRefPath)\%(Identity).dll')">
<TargetFramework>$(TargetFramework)</TargetFramework>
</RefFile>
<LibFile Include="$(NETStandardPackageRefPath)\*.dll" Exclude="@(_excludeShimsLib->'$(NETStandardPackageRefPath)\%(Identity).dll')">
<TargetFramework>$(TargetFramework)</TargetFramework>
</LibFile>
Expand Down Expand Up @@ -98,21 +94,12 @@

<Target Name="AddFrameworkClosureFiles" AfterTargets="ExpandClosureFilesByTargetFramework">
<ItemGroup>
<FrameworkClosureFile Include="@(NetFxReference->'$(RefRootPath)netfx/%(Identity).dll')" >
<FileSet>reference-net461</FileSet>
</FrameworkClosureFile>
<FrameworkClosureFile Include="@(NetFxReference->'$(RefRootPath)netfx/%(Identity).dll')" >
<FileSet>runtime-net461</FileSet>
</FrameworkClosureFile>
<FrameworkClosureFile Include="@(NetFxReference->'$(RefRootPath)net462/%(Identity).dll')" >
<FileSet>reference-net462</FileSet>
</FrameworkClosureFile>
<FrameworkClosureFile Include="@(NetFxReference->'$(RefRootPath)net462/%(Identity).dll')" >
<FileSet>runtime-net462</FileSet>
</FrameworkClosureFile>
<FrameworkClosureFile Include="@(NetFxReference->'$(RefRootPath)net47/%(Identity).dll')" >
<FileSet>reference-net47</FileSet>
</FrameworkClosureFile>
<FrameworkClosureFile Include="@(NetFxReference->'$(RefRootPath)net47/%(Identity).dll')" >
<FileSet>runtime-net47</FileSet>
</FrameworkClosureFile>
Expand Down Expand Up @@ -163,10 +150,6 @@
</PropertyGroup>

<ItemGroup>
<!-- Include refs -->
<File Include="@(RefFile)">
<TargetPath Condition="'%(RefFile.TargetPath)' == ''">build/%(RefFile.TargetFramework)/ref%(RefFile.SubFolder)</TargetPath>
</File>

<!-- Include lib -->
<File Include="@(LibFile)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,9 @@
consider a project with an Reference Include="System", and some NuGet package is providing System.dll.
Simple references can also come from NuGet framework assemblies, hence this statement should occur after
including all computed references. -->
<Reference Remove="%(_NETStandardLibraryNETFrameworkReference.FileName)" />

<Reference Include="@(_NETStandardLibraryNETFrameworkReference)">
<!-- Private = false to make these reference only -->
<Private>false</Private>
<NuGetPackageId>NETStandard.Library.NETFramework</NuGetPackageId>
<NuGetPackageVersion>$(NETStandardLibraryNETFrameworkPackageVersion)</NuGetPackageVersion>
</Reference>
<Reference Remove="%(_NETStandardLibraryNETFrameworkLib.FileName)" />

<ReferenceCopyLocalPaths Include="@(_NETStandardLibraryNETFrameworkLib)">
<Private>false</Private>
<NuGetPackageId>NETStandard.Library.NETFramework</NuGetPackageId>
<NuGetPackageVersion>$(NETStandardLibraryPackageVersion)</NuGetPackageVersion>
</ReferenceCopyLocalPaths>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Condition="'$(ImplicitlyExpandNETStandardFacades)' == 'true'">
<_NETStandardLibraryNETFrameworkReference Include="$(MSBuildThisFileDirectory)\ref\*.dll"
Exclude="@(_NETStandardLibraryNETFrameworkReference->'$(MSBuildThisFileDirectory)\ref\%(FileName).dll')" />

<_NETStandardLibraryNETFrameworkLib Include="$(MSBuildThisFileDirectory)\lib\*.dll"
Exclude="@(_NETStandardLibraryNETFrameworkLib->'$(MSBuildThisFileDirectory)\ref\%(FileName).dll')" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Condition="'$(ImplicitlyExpandNETStandardFacades)' == 'true'">
<_NETStandardLibraryNETFrameworkReference Include="$(MSBuildThisFileDirectory)\ref\*.dll"
Exclude="@(_NETStandardLibraryNETFrameworkReference->'$(MSBuildThisFileDirectory)\ref\%(FileName).dll')" />

<_NETStandardLibraryNETFrameworkLib Include="$(MSBuildThisFileDirectory)\lib\*.dll"
Exclude="@(_NETStandardLibraryNETFrameworkLib->'$(MSBuildThisFileDirectory)\ref\%(FileName).dll')" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Condition="'$(ImplicitlyExpandNETStandardFacades)' == 'true'">
<_NETStandardLibraryNETFrameworkReference Include="$(MSBuildThisFileDirectory)\ref\*.dll"
Exclude="@(_NETStandardLibraryNETFrameworkReference->'$(MSBuildThisFileDirectory)\ref\%(FileName).dll')" />

<_NETStandardLibraryNETFrameworkLib Include="$(MSBuildThisFileDirectory)\lib\*.dll"
Exclude="@(_NETStandardLibraryNETFrameworkLib->'$(MSBuildThisFileDirectory)\ref\%(FileName).dll')" />
</ItemGroup>
Expand Down
4 changes: 1 addition & 3 deletions src/netfx.force.conflict/dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<!-- this assembly is not versioned, it only contains type forwards and will never be referenced by another assembly -->
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyKey>Open</AssemblyKey>
<!-- this assembly only appears in ref -->
<IsNetFxNETStandard>false</IsNetFxNETStandard>
<IsNetFxNETStandardRef>true</IsNetFxNETStandardRef>
<IsNetFxNETStandard>true</IsNetFxNETStandard>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions src/packages.builds
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
<Project Include="$(MSBuildThisFileDirectory)..\pkg\Microsoft.Private.CoreFx.NETCoreApp\Microsoft.Private.CoreFx.NETCoreApp.builds">
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
<Project Include="$(MSBuildThisFileDirectory)..\pkg\NETStandard.Library.NETFramework\NETStandard.Library.NETFramework.builds">
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
<Project Include="$(MSBuildThisFileDirectory)\System.Data.SqlClient\pkg\System.Data.SqlClient.pkgproj">
<AdditionalProperties>$(AdditionalProperties)</AdditionalProperties>
</Project>
Expand Down

0 comments on commit fbdc453

Please sign in to comment.