Skip to content

Commit

Permalink
Add Release-NoCostura build configuration
Browse files Browse the repository at this point in the history
This build configuration doesn't run Costura, which squishes all dependencies into the target binary. The native dependencies are also not embedded into the final binary, and are instead copied over to the output directory.

The rationale for adding this configuration is that the way Costura expands and loads managed and unmanaged dependencies can be problematic in some hosting environments, namely Azure App Service.
  • Loading branch information
goldshtn committed Sep 28, 2016
1 parent 7923d03 commit 7b9d6f4
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 5 deletions.
18 changes: 18 additions & 0 deletions ClrMemDiagExt/ClrMemDiagExt.csproj
Expand Up @@ -57,6 +57,24 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-NoCostura|x86'">
<OutputPath>bin\x86\Release-NoCostura\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-NoCostura|x64'">
<OutputPath>bin\x64\Release-NoCostura\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Diagnostics.Runtime, Version=0.8.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Diagnostics.Runtime.0.8.31\lib\net45\Microsoft.Diagnostics.Runtime.dll</HintPath>
Expand Down
18 changes: 18 additions & 0 deletions CmdLine.Tests/CmdLine.Tests.csproj
Expand Up @@ -56,6 +56,24 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-NoCostura|x86'">
<OutputPath>bin\x86\Release-NoCostura\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-NoCostura|x64'">
<OutputPath>bin\x64\Release-NoCostura\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
Expand Down
18 changes: 18 additions & 0 deletions CmdLine/CmdLine.csproj
Expand Up @@ -51,6 +51,24 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-NoCostura|x86'">
<OutputPath>bin\x86\Release-NoCostura\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-NoCostura|x64'">
<OutputPath>bin\x64\Release-NoCostura\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
20 changes: 20 additions & 0 deletions DumpWriter/DumpWriter.csproj
Expand Up @@ -55,6 +55,26 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-NoCostura|x86'">
<OutputPath>bin\x86\Release-NoCostura\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-NoCostura|x64'">
<OutputPath>bin\x64\Release-NoCostura\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="C5, Version=2.4.5947.17248, Culture=neutral, PublicKeyToken=282361b99ded7e8e, processorArchitecture=MSIL">
<HintPath>..\packages\C5.2.4.5947.17249\lib\net45\C5.dll</HintPath>
Expand Down
22 changes: 22 additions & 0 deletions msos.sln
Expand Up @@ -35,6 +35,8 @@ Global
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
Release-NoCostura|x64 = Release-NoCostura|x64
Release-NoCostura|x86 = Release-NoCostura|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{18421729-EAD5-41D1-857C-D496466FAC2D}.Debug|x64.ActiveCfg = Debug|x64
Expand All @@ -45,6 +47,10 @@ Global
{18421729-EAD5-41D1-857C-D496466FAC2D}.Release|x64.Build.0 = Release|x64
{18421729-EAD5-41D1-857C-D496466FAC2D}.Release|x86.ActiveCfg = Release|x86
{18421729-EAD5-41D1-857C-D496466FAC2D}.Release|x86.Build.0 = Release|x86
{18421729-EAD5-41D1-857C-D496466FAC2D}.Release-NoCostura|x64.ActiveCfg = Release-NoCostura|x64
{18421729-EAD5-41D1-857C-D496466FAC2D}.Release-NoCostura|x64.Build.0 = Release-NoCostura|x64
{18421729-EAD5-41D1-857C-D496466FAC2D}.Release-NoCostura|x86.ActiveCfg = Release-NoCostura|x86
{18421729-EAD5-41D1-857C-D496466FAC2D}.Release-NoCostura|x86.Build.0 = Release-NoCostura|x86
{249A0236-8FC8-4CD7-B6E1-C3422924EA09}.Debug|x64.ActiveCfg = Debug|x64
{249A0236-8FC8-4CD7-B6E1-C3422924EA09}.Debug|x64.Build.0 = Debug|x64
{249A0236-8FC8-4CD7-B6E1-C3422924EA09}.Debug|x86.ActiveCfg = Debug|x86
Expand All @@ -53,6 +59,10 @@ Global
{249A0236-8FC8-4CD7-B6E1-C3422924EA09}.Release|x64.Build.0 = Release|x64
{249A0236-8FC8-4CD7-B6E1-C3422924EA09}.Release|x86.ActiveCfg = Release|x86
{249A0236-8FC8-4CD7-B6E1-C3422924EA09}.Release|x86.Build.0 = Release|x86
{249A0236-8FC8-4CD7-B6E1-C3422924EA09}.Release-NoCostura|x64.ActiveCfg = Release-NoCostura|x64
{249A0236-8FC8-4CD7-B6E1-C3422924EA09}.Release-NoCostura|x64.Build.0 = Release-NoCostura|x64
{249A0236-8FC8-4CD7-B6E1-C3422924EA09}.Release-NoCostura|x86.ActiveCfg = Release-NoCostura|x86
{249A0236-8FC8-4CD7-B6E1-C3422924EA09}.Release-NoCostura|x86.Build.0 = Release-NoCostura|x86
{F634ED9D-3A0F-4FC4-988C-BB319BB69FA6}.Debug|x64.ActiveCfg = Debug|x64
{F634ED9D-3A0F-4FC4-988C-BB319BB69FA6}.Debug|x64.Build.0 = Debug|x64
{F634ED9D-3A0F-4FC4-988C-BB319BB69FA6}.Debug|x86.ActiveCfg = Debug|x86
Expand All @@ -61,12 +71,20 @@ Global
{F634ED9D-3A0F-4FC4-988C-BB319BB69FA6}.Release|x64.Build.0 = Release|x64
{F634ED9D-3A0F-4FC4-988C-BB319BB69FA6}.Release|x86.ActiveCfg = Release|x86
{F634ED9D-3A0F-4FC4-988C-BB319BB69FA6}.Release|x86.Build.0 = Release|x86
{F634ED9D-3A0F-4FC4-988C-BB319BB69FA6}.Release-NoCostura|x64.ActiveCfg = Release-NoCostura|x64
{F634ED9D-3A0F-4FC4-988C-BB319BB69FA6}.Release-NoCostura|x64.Build.0 = Release-NoCostura|x64
{F634ED9D-3A0F-4FC4-988C-BB319BB69FA6}.Release-NoCostura|x86.ActiveCfg = Release-NoCostura|x86
{F634ED9D-3A0F-4FC4-988C-BB319BB69FA6}.Release-NoCostura|x86.Build.0 = Release-NoCostura|x86
{168BD1D6-F926-4D6E-BBBC-873C0D4E6CB3}.Debug|x64.ActiveCfg = Debug|x64
{168BD1D6-F926-4D6E-BBBC-873C0D4E6CB3}.Debug|x86.ActiveCfg = Debug|x86
{168BD1D6-F926-4D6E-BBBC-873C0D4E6CB3}.Debug|x86.Build.0 = Debug|x86
{168BD1D6-F926-4D6E-BBBC-873C0D4E6CB3}.Release|x64.ActiveCfg = Release|x64
{168BD1D6-F926-4D6E-BBBC-873C0D4E6CB3}.Release|x86.ActiveCfg = Release|x86
{168BD1D6-F926-4D6E-BBBC-873C0D4E6CB3}.Release|x86.Build.0 = Release|x86
{168BD1D6-F926-4D6E-BBBC-873C0D4E6CB3}.Release-NoCostura|x64.ActiveCfg = Release-NoCostura|x64
{168BD1D6-F926-4D6E-BBBC-873C0D4E6CB3}.Release-NoCostura|x64.Build.0 = Release-NoCostura|x64
{168BD1D6-F926-4D6E-BBBC-873C0D4E6CB3}.Release-NoCostura|x86.ActiveCfg = Release-NoCostura|x86
{168BD1D6-F926-4D6E-BBBC-873C0D4E6CB3}.Release-NoCostura|x86.Build.0 = Release-NoCostura|x86
{1C19B4D7-E6A6-4A9A-8495-8231FA167D1C}.Debug|x64.ActiveCfg = Debug|x64
{1C19B4D7-E6A6-4A9A-8495-8231FA167D1C}.Debug|x64.Build.0 = Debug|x64
{1C19B4D7-E6A6-4A9A-8495-8231FA167D1C}.Debug|x86.ActiveCfg = Debug|x86
Expand All @@ -75,6 +93,10 @@ Global
{1C19B4D7-E6A6-4A9A-8495-8231FA167D1C}.Release|x64.Build.0 = Release|x64
{1C19B4D7-E6A6-4A9A-8495-8231FA167D1C}.Release|x86.ActiveCfg = Release|x86
{1C19B4D7-E6A6-4A9A-8495-8231FA167D1C}.Release|x86.Build.0 = Release|x86
{1C19B4D7-E6A6-4A9A-8495-8231FA167D1C}.Release-NoCostura|x64.ActiveCfg = Release-NoCostura|x64
{1C19B4D7-E6A6-4A9A-8495-8231FA167D1C}.Release-NoCostura|x64.Build.0 = Release-NoCostura|x64
{1C19B4D7-E6A6-4A9A-8495-8231FA167D1C}.Release-NoCostura|x86.ActiveCfg = Release-NoCostura|x86
{1C19B4D7-E6A6-4A9A-8495-8231FA167D1C}.Release-NoCostura|x86.Build.0 = Release-NoCostura|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
36 changes: 31 additions & 5 deletions msos/msos.csproj
Expand Up @@ -64,6 +64,30 @@
<UseVSHostingProcess>false</UseVSHostingProcess>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-NoCostura|x86'">
<OutputPath>bin\x86\Release-NoCostura\</OutputPath>
<DefineConstants>TRACE;X86</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-NoCostura|x64'">
<OutputPath>bin\x64\Release-NoCostura\</OutputPath>
<DefineConstants>TRACE;X64</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="ICSharpCode.Decompiler">
<HintPath>..\packages\ICSharpCode.Decompiler.2.3.1\lib\Net40\ICSharpCode.Decompiler.dll</HintPath>
Expand Down Expand Up @@ -213,13 +237,13 @@
<Name>DumpWriter</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup Condition="'$(Platform)' == 'x86'">
<ItemGroup Condition="'$(Platform)' == 'x86' And '$(Configuration)' != 'Release-NoCostura'">
<EmbeddedResource Include="costura32\msdia120.dll" />
<EmbeddedResource Include="costura32\dbgeng.dll" />
<EmbeddedResource Include="costura32\dbghelp.dll" />
<EmbeddedResource Include="costura32\symsrv.dll" />
</ItemGroup>
<ItemGroup Condition="'$(Platform)' == 'x64'">
<ItemGroup Condition="'$(Platform)' == 'x64' And '$(Configuration)' != 'Release-NoCostura'">
<EmbeddedResource Include="costura64\msdia120.dll" />
<EmbeddedResource Include="costura64\dbgeng.dll" />
<EmbeddedResource Include="costura64\dbghelp.dll" />
Expand Down Expand Up @@ -275,14 +299,16 @@ foreach (var item in filesToCleanup)
</Task>
</UsingTask>
<Target Name="CleanReferenceCopyLocalPaths" AfterTargets="AfterBuild;NonWinFodyTarget">
<CosturaCleanup Config="FodyWeavers.xml" Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />
<CosturaCleanup Config="FodyWeavers.xml" Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" Condition="'$(Configuration)' != 'Release-NoCostura'" />
</Target>
<PropertyGroup>
<PostBuildEvent>call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\vsvars32.bat"
editbin /largeaddressaware "$(TargetPath)"</PostBuildEvent>
<PostBuildEvent Condition="'$(Platform)' == 'x86' And '$(Configuration)' == 'Release-NoCostura'">xcopy /Y /F "$(ProjectDir)"costura32\*.dll .</PostBuildEvent>
<PostBuildEvent Condition="'$(Platform)' == 'x64' And '$(Configuration)' == 'Release-NoCostura'">xcopy /Y /F "$(ProjectDir)"costura64\*.dll .</PostBuildEvent>
</PropertyGroup>
<Import Project="..\packages\Costura.Fody.2.0.0-beta0018\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.2.0.0-beta0018\build\Costura.Fody.targets')" />
<Import Project="..\packages\Fody.1.29.4\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.1.29.4\build\dotnet\Fody.targets')" />
<Import Project="..\packages\Costura.Fody.2.0.0-beta0018\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.2.0.0-beta0018\build\Costura.Fody.targets') And '$(Configuration)' != 'Release-NoCostura'" />
<Import Project="..\packages\Fody.1.29.4\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.1.29.4\build\dotnet\Fody.targets') And '$(Configuration)' != 'Release-NoCostura'" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down

0 comments on commit 7b9d6f4

Please sign in to comment.