title: Cannot sign C++/CLI assembly in Visual Studio 2015
body: <p>Using Visual Studio 2015, with the 2015 toolset: when I try to directly sign the assembly as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/Ntc6o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ntc6o.png" alt="Signing a C++/CLI assembly"></a></p>
  
  <p>The signing always fails with the following error:
  <code>LNK1346    ALINK operation failed (80040436) : Error signing assembly -- The process cannot access the file because it is being used by another process.</code></p>
  
  <p>This same assembly could be signed in Visual Studio 2013 (I've just upgraded it today).</p>
  
  <p>Is this a known issue in 2015 (couldn't find any bugs when I searched that error)? Or am I doing something wrong?</p>
  
  <p><strong>EDIT: Workaround</strong></p>
  
  <p>It seems that this is yet another McAfee AV bug. However, there is another way to sign the file that might give McVirus enough time to release the lock it has taken out.</p>
  
  <p>The assembly can be delay signed and <code>sn -R $(TargetPath) $(LinkKeyFile)</code> can be run as as a post build event to complete the signing. This worked for me and @Moop.</p>