Skip to content

Commit

Permalink
Add .NET Framework reference assembly packages
Browse files Browse the repository at this point in the history
This should make it possible to build Moq on machines using `dotnet`
even when Visual Studio is not installed.

(Reference assemblies for the .NET Framework used to be only available
on your machine if you installed Visual Studio, but now they have been
made available through a NuGet package.)
  • Loading branch information
stakx committed Sep 29, 2020
1 parent 9a2114c commit 0b72076
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Moq/Moq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
<PackageReference Include="TypeNameFormatter.Sources" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net45" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
Expand Down
4 changes: 4 additions & 0 deletions tests/Moq.Tests.FSharpTypes/Moq.Tests.FSharpTypes.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.0" />
</ItemGroup>

<ItemGroup>
<Compile Include="HasAbstractActionEvent.fs" />
<Compile Include="HasAbstractEventHandlerEvent.fs" />
Expand Down
4 changes: 4 additions & 0 deletions tests/Moq.Tests.VisualBasic/Moq.Tests.VisualBasic.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@
<ProjectReference Include="..\..\src\Moq\Moq.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.0" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions tests/Moq.Tests/Moq.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
<ItemGroup Condition=" $([System.Text.RegularExpressions.Regex]::IsMatch('$(DefineConstants)', 'FEATURE_SYSTEM_WINDOWS_FORMS'))">
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
<PackageReference Include="System.ComponentModel.Primitives" Version="4.3.0" />
Expand Down

0 comments on commit 0b72076

Please sign in to comment.