title: How can I disable code signing for debug builds in Visual Studio 2013?
body: <p>We recently upgraded Visual Studio from 2010 to 2013 and everything seems to be working the same as before except for one thing. In 2010 code signing was only performed when publishing the project, but in 2013 it wants to sign the output assembly every time we build the project.</p>
  
  <p>I'm having issues trying to find any results online about this, everything only points to how to setup signing in the first place, not how to prevent it signing during normal debug builds.</p>
  
  <hr>
  
  <p>I created a new project and started playing with the settings to determine what single setting may be triggering the signing requirement during normal builds. In the project properties page under the Security tab, if the "Enable ClickOnce security settings" check box is checked then 2013 requires the signing step but 2010 doesn't seem to have that requirement.</p>
  
  <p>I still need to confirm whether or not this is the single decision point for this behavior.</p>
  
  <hr>
  
  <p>Confirmed.</p>
  
  <p>I created two solutions each with a single empty WinForms application. One solution was created in Visual Studio 2010 and the other was created in Visual Studio 2013. I went into the project properties on each and enabled signing via the signing tab and then checked the "Enable ClickOnce security settings" in the security tab with "This is a full trust application". Note that the projects are being signed with a certificate on a smart-card which is PIN enabled.</p>
  
  <p>VS 2013 prompts for the smart card PIN during a normal build in debug mode, 2010 does not. Now the question is basically why there is a difference between the two versions and how to fix this in 2013 to behave like 2010.</p>
  
  <hr>
  
  <p>I'm including the project files for the test solutions I created below. Comparing the differences doesn't point to anything obviously different. I also attempted to change the VS 2013 project to target the same framework as the VS 2010 project to minimize the differences between the projects - this doesn't change the behavior difference.</p>
  
  <p>Visual Studio 2010 Project File</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    &lt;PropertyGroup&gt;
      &lt;Configuration Condition=" '$(Configuration)' == '' "&gt;Debug&lt;/Configuration&gt;
      &lt;Platform Condition=" '$(Platform)' == '' "&gt;x86&lt;/Platform&gt;
      &lt;ProductVersion&gt;8.0.30703&lt;/ProductVersion&gt;
      &lt;SchemaVersion&gt;2.0&lt;/SchemaVersion&gt;
      &lt;ProjectGuid&gt;{E31DA60C-E444-4E34-AF6D-5B4588CC1F8E}&lt;/ProjectGuid&gt;
      &lt;OutputType&gt;WinExe&lt;/OutputType&gt;
      &lt;AppDesignerFolder&gt;Properties&lt;/AppDesignerFolder&gt;
      &lt;RootNamespace&gt;SigningTest1&lt;/RootNamespace&gt;
      &lt;AssemblyName&gt;SigningTest1&lt;/AssemblyName&gt;
      &lt;TargetFrameworkVersion&gt;v4.0&lt;/TargetFrameworkVersion&gt;
      &lt;TargetFrameworkProfile&gt;Client&lt;/TargetFrameworkProfile&gt;
      &lt;FileAlignment&gt;512&lt;/FileAlignment&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "&gt;
      &lt;PlatformTarget&gt;x86&lt;/PlatformTarget&gt;
      &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
      &lt;DebugType&gt;full&lt;/DebugType&gt;
      &lt;Optimize&gt;false&lt;/Optimize&gt;
      &lt;OutputPath&gt;bin\Debug\&lt;/OutputPath&gt;
      &lt;DefineConstants&gt;DEBUG;TRACE&lt;/DefineConstants&gt;
      &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
      &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "&gt;
      &lt;PlatformTarget&gt;x86&lt;/PlatformTarget&gt;
      &lt;DebugType&gt;pdbonly&lt;/DebugType&gt;
      &lt;Optimize&gt;true&lt;/Optimize&gt;
      &lt;OutputPath&gt;bin\Release\&lt;/OutputPath&gt;
      &lt;DefineConstants&gt;TRACE&lt;/DefineConstants&gt;
      &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
      &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;SignManifests&gt;true&lt;/SignManifests&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;ManifestCertificateThumbprint&gt;22E252B5076264F4F2CD88983A9053D554CCD185&lt;/ManifestCertificateThumbprint&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;TargetZone&gt;LocalIntranet&lt;/TargetZone&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;GenerateManifests&gt;true&lt;/GenerateManifests&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;ApplicationManifest&gt;Properties\app.manifest&lt;/ApplicationManifest&gt;
    &lt;/PropertyGroup&gt;
    &lt;ItemGroup&gt;
      &lt;Reference Include="System" /&gt;
      &lt;Reference Include="System.Core" /&gt;
      &lt;Reference Include="System.Xml.Linq" /&gt;
      &lt;Reference Include="System.Data.DataSetExtensions" /&gt;
      &lt;Reference Include="Microsoft.CSharp" /&gt;
      &lt;Reference Include="System.Data" /&gt;
      &lt;Reference Include="System.Deployment" /&gt;
      &lt;Reference Include="System.Drawing" /&gt;
      &lt;Reference Include="System.Windows.Forms" /&gt;
      &lt;Reference Include="System.Xml" /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;Compile Include="Form1.cs"&gt;
        &lt;SubType&gt;Form&lt;/SubType&gt;
      &lt;/Compile&gt;
      &lt;Compile Include="Form1.Designer.cs"&gt;
        &lt;DependentUpon&gt;Form1.cs&lt;/DependentUpon&gt;
      &lt;/Compile&gt;
      &lt;Compile Include="Program.cs" /&gt;
      &lt;Compile Include="Properties\AssemblyInfo.cs" /&gt;
      &lt;EmbeddedResource Include="Properties\Resources.resx"&gt;
        &lt;Generator&gt;ResXFileCodeGenerator&lt;/Generator&gt;
        &lt;LastGenOutput&gt;Resources.Designer.cs&lt;/LastGenOutput&gt;
        &lt;SubType&gt;Designer&lt;/SubType&gt;
      &lt;/EmbeddedResource&gt;
      &lt;Compile Include="Properties\Resources.Designer.cs"&gt;
        &lt;AutoGen&gt;True&lt;/AutoGen&gt;
        &lt;DependentUpon&gt;Resources.resx&lt;/DependentUpon&gt;
      &lt;/Compile&gt;
      &lt;None Include="Properties\app.manifest" /&gt;
      &lt;None Include="Properties\Settings.settings"&gt;
        &lt;Generator&gt;SettingsSingleFileGenerator&lt;/Generator&gt;
        &lt;LastGenOutput&gt;Settings.Designer.cs&lt;/LastGenOutput&gt;
      &lt;/None&gt;
      &lt;Compile Include="Properties\Settings.Designer.cs"&gt;
        &lt;AutoGen&gt;True&lt;/AutoGen&gt;
        &lt;DependentUpon&gt;Settings.settings&lt;/DependentUpon&gt;
        &lt;DesignTimeSharedInput&gt;True&lt;/DesignTimeSharedInput&gt;
      &lt;/Compile&gt;
    &lt;/ItemGroup&gt;
    &lt;Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /&gt;
    &lt;!-- 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.
    &lt;Target Name="BeforeBuild"&gt;
    &lt;/Target&gt;
    &lt;Target Name="AfterBuild"&gt;
    &lt;/Target&gt;
    --&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>Visual Studio 2013 Project File</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    &lt;Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /&gt;
    &lt;PropertyGroup&gt;
      &lt;Configuration Condition=" '$(Configuration)' == '' "&gt;Debug&lt;/Configuration&gt;
      &lt;Platform Condition=" '$(Platform)' == '' "&gt;AnyCPU&lt;/Platform&gt;
      &lt;ProjectGuid&gt;{732A657C-452D-4942-8832-89A14314739C}&lt;/ProjectGuid&gt;
      &lt;OutputType&gt;WinExe&lt;/OutputType&gt;
      &lt;AppDesignerFolder&gt;Properties&lt;/AppDesignerFolder&gt;
      &lt;RootNamespace&gt;SigningTest2013&lt;/RootNamespace&gt;
      &lt;AssemblyName&gt;SigningTest2013&lt;/AssemblyName&gt;
      &lt;TargetFrameworkVersion&gt;v4.0&lt;/TargetFrameworkVersion&gt;
      &lt;TargetFrameworkProfile&gt;Client&lt;/TargetFrameworkProfile&gt;
      &lt;FileAlignment&gt;512&lt;/FileAlignment&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "&gt;
      &lt;PlatformTarget&gt;AnyCPU&lt;/PlatformTarget&gt;
      &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
      &lt;DebugType&gt;full&lt;/DebugType&gt;
      &lt;Optimize&gt;false&lt;/Optimize&gt;
      &lt;OutputPath&gt;bin\Debug\&lt;/OutputPath&gt;
      &lt;DefineConstants&gt;DEBUG;TRACE&lt;/DefineConstants&gt;
      &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
      &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "&gt;
      &lt;PlatformTarget&gt;AnyCPU&lt;/PlatformTarget&gt;
      &lt;DebugType&gt;pdbonly&lt;/DebugType&gt;
      &lt;Optimize&gt;true&lt;/Optimize&gt;
      &lt;OutputPath&gt;bin\Release\&lt;/OutputPath&gt;
      &lt;DefineConstants&gt;TRACE&lt;/DefineConstants&gt;
      &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
      &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;SignManifests&gt;true&lt;/SignManifests&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;ManifestCertificateThumbprint&gt;22E252B5076264F4F2CD88983A9053D554CCD185&lt;/ManifestCertificateThumbprint&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;TargetZone&gt;LocalIntranet&lt;/TargetZone&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;GenerateManifests&gt;true&lt;/GenerateManifests&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;ApplicationManifest&gt;Properties\app.manifest&lt;/ApplicationManifest&gt;
    &lt;/PropertyGroup&gt;
    &lt;ItemGroup&gt;
      &lt;Reference Include="System" /&gt;
      &lt;Reference Include="System.Core" /&gt;
      &lt;Reference Include="System.Xml.Linq" /&gt;
      &lt;Reference Include="System.Data.DataSetExtensions" /&gt;
      &lt;Reference Include="Microsoft.CSharp" /&gt;
      &lt;Reference Include="System.Data" /&gt;
      &lt;Reference Include="System.Deployment" /&gt;
      &lt;Reference Include="System.Drawing" /&gt;
      &lt;Reference Include="System.Windows.Forms" /&gt;
      &lt;Reference Include="System.Xml" /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;Compile Include="Form1.cs"&gt;
        &lt;SubType&gt;Form&lt;/SubType&gt;
      &lt;/Compile&gt;
      &lt;Compile Include="Form1.Designer.cs"&gt;
        &lt;DependentUpon&gt;Form1.cs&lt;/DependentUpon&gt;
      &lt;/Compile&gt;
      &lt;Compile Include="Program.cs" /&gt;
      &lt;Compile Include="Properties\AssemblyInfo.cs" /&gt;
      &lt;EmbeddedResource Include="Properties\Resources.resx"&gt;
        &lt;Generator&gt;ResXFileCodeGenerator&lt;/Generator&gt;
        &lt;LastGenOutput&gt;Resources.Designer.cs&lt;/LastGenOutput&gt;
        &lt;SubType&gt;Designer&lt;/SubType&gt;
      &lt;/EmbeddedResource&gt;
      &lt;Compile Include="Properties\Resources.Designer.cs"&gt;
        &lt;AutoGen&gt;True&lt;/AutoGen&gt;
        &lt;DependentUpon&gt;Resources.resx&lt;/DependentUpon&gt;
        &lt;DesignTime&gt;True&lt;/DesignTime&gt;
      &lt;/Compile&gt;
      &lt;None Include="Properties\app.manifest" /&gt;
      &lt;None Include="Properties\Settings.settings"&gt;
        &lt;Generator&gt;SettingsSingleFileGenerator&lt;/Generator&gt;
        &lt;LastGenOutput&gt;Settings.Designer.cs&lt;/LastGenOutput&gt;
      &lt;/None&gt;
      &lt;Compile Include="Properties\Settings.Designer.cs"&gt;
        &lt;AutoGen&gt;True&lt;/AutoGen&gt;
        &lt;DependentUpon&gt;Settings.settings&lt;/DependentUpon&gt;
        &lt;DesignTimeSharedInput&gt;True&lt;/DesignTimeSharedInput&gt;
      &lt;/Compile&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;None Include="App.config" /&gt;
    &lt;/ItemGroup&gt;
    &lt;Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /&gt;
    &lt;!-- 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.
    &lt;Target Name="BeforeBuild"&gt;
    &lt;/Target&gt;
    &lt;Target Name="AfterBuild"&gt;
    &lt;/Target&gt;
    --&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>I'll attempt to upload a full solution for each when I can. I'm unable to do it from my current computer due to most file sharing websites being blocked.</p>