Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
Fix VS build after signing change in master
Browse files Browse the repository at this point in the history
  • Loading branch information
cbnilrem committed Jun 9, 2016
1 parent d8dae61 commit 406a859
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DefineConstants>TRACE;DEBUG;VS2015</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
Expand Down Expand Up @@ -63,6 +63,9 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\test\Microsoft.Management.Infrastructure.Tests\AssemblyInfo.cs">
<Link>AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\..\..\test\Microsoft.Management.Infrastructure.Tests\CimInstanceTests.cs">
<Link>CimInstanceTests.cs</Link>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;UNSIGNED VS2015</DefineConstants>
<DefineConstants>TRACE;DEBUG;VS2015</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
24 changes: 14 additions & 10 deletions src/Microsoft.Management.Infrastructure/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
using System.Runtime.InteropServices;

#if _CORECLR
[assembly:InternalsVisibleTo("System.Management.Automation")]
[assembly:InternalsVisibleTo("Microsoft.Management.Infrastructure.Tests")]
[assembly:AssemblyFileVersionAttribute("1.0.0.0")]
[assembly:AssemblyVersion("1.0.0.0")]
[assembly: InternalsVisibleTo("System.Management.Automation")]
[assembly: InternalsVisibleTo("Microsoft.Management.Infrastructure.Tests")]
[assembly: AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: InternalsVisibleTo("Microsoft.Windows.DSC.CoreConfProviders")]
[assembly: InternalsVisibleTo("Microsoft.Management.Infrastructure.CimCmdlets")]
#else
Expand All @@ -25,11 +25,15 @@
[assembly: InternalsVisibleTo("Microsoft.Windows.DSC.CoreConfProviders,PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: InternalsVisibleTo("Microsoft.Monitoring.Commands,PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: InternalsVisibleTo("Microsoft.Management.Infrastructure.CimCmdlets,PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
// NOTE: MMI.Tests is not currently being built for FullCLR. If this changes,
// uncomment the following line and also add assembly signing attributes to MMI.Tests's AssemblyInfo.cs
// [assembly: InternalsVisibleTo("Microsoft.Management.Infrastructure.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
#if !UNSIGNED
[assembly:AssemblyKeyFileAttribute(@"..\..\signing\visualstudiopublic.snk")]
[assembly:AssemblyDelaySign(true)]

// VS2015 xUnit test runner has a bug in which tests are not discovered in signed test assemblies
// Since a signed product assembly requires signing the associated test assembly we disable
// signing either assembly when compiled in FullCLR + VS2015
#if VS2015
[assembly: InternalsVisibleTo("Microsoft.Management.Infrastructure.Tests")]
#else
[assembly: InternalsVisibleTo("Microsoft.Management.Infrastructure.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: AssemblyKeyFileAttribute(@"..\..\signing\visualstudiopublic.snk")]
[assembly: AssemblyDelaySign(true)]
#endif
#endif
18 changes: 16 additions & 2 deletions test/Microsoft.Management.Infrastructure.Tests/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
using Xunit;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Xunit;

// 0 means use one thread per processor
[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, MaxParallelThreads = 0)]
[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, MaxParallelThreads = 0)]

// VS2015 xUnit test runner has a bug in which tests are not discovered in signed test assemblies
// Disable signing the test assembly if compiled under VS
#if VS2015
[assembly: InternalsVisibleTo("Microsoft.Management.Infrastructure.Tests")]
#else
[assembly: AssemblyKeyFileAttribute(@"..\..\signing\visualstudiopublic.snk")]
[assembly: AssemblyDelaySign(true)]
#endif

0 comments on commit 406a859

Please sign in to comment.