Remove signature from assembly

I have a project open in Visual Studio (this is usually Enyim.Caching). This assembly wants to be delayed. In fact, he wants to be delayed so badly that I cannot get Visual Studio to compile it without delay.

  • I unchecked the "Only delay sign" and "Sign the assembly" in the properties window of the Visual Studio project and rebuilt. The node is still marked with a delay sign (as shown by sn.exe -v ).

  • I uploaded the project and confirmed that the signature is set to false. When you restart the project, the check boxes for the "Sign" and "Delay icon" are checked.

  • I checked that there are no attributes in AssemblyInfo (or elsewhere) that could cause this.

  • I searched the Internet for a solution, but did not find it.

How can i do this?

+7
source share
2 answers

In this case, the problem is a link to the "general properties" project.

Inside the .csproj file is this harmless little line:

<Import project = ".. \ build \ CommonProperties.targets" />

Unfortunately, the file ( CommonProperties.targets ) tells VS to overwrite the properties, but this user interface does not contain clear instructions. In my opinion, the one who designed it should be damp and feathered.

The solution is to go to the CommonProperties.targets file and delete the following lines:

 <!-- delay sign the assembly if the PrivateKeyPath property is not specified --> <PropertyGroup Condition=" '$(PrivateKeyPath)' == '' And '$(PrivateKeyName)' == ''"> <AssemblyOriginatorKeyFile>..\public_key.snk</AssemblyOriginatorKeyFile> <DelaySign>true</DelaySign> </PropertyGroup> <!-- sign the assembly using the specified key file containing both the private and public keys --> <PropertyGroup Condition=" '$(PrivateKeyPath)' != '' "> <AssemblyOriginatorKeyFile>$(PrivateKeyPath)</AssemblyOriginatorKeyFile> <DelaySign>false</DelaySign> </PropertyGroup> <!-- sign the assembly using the specified key container containing both the private and public keys --> <PropertyGroup Condition=" '$(PrivateKeyName)' != '' "> <AssemblyOriginatorKeyFile></AssemblyOriginatorKeyFile> <DelaySign>false</DelaySign> </PropertyGroup> 

Replace these lines as follows:

  <PropertyGroup> <DelaySign>false</DelaySign> <SignAssembly>false</SignAssembly> </PropertyGroup> 
+9
source

Met the same problem. Even after I turned off “Delay sign only” and “Sign assembly”, I still got an error

 error MSB3325: Cannot import the following key file: . The key file may be password protected". 

And the correct .csproj:

 <PropertyGroup> <SignAssembly>false</SignAssembly> <DelaySign>false</DelaySign> </PropertyGroup> 

However, there is another complicated line below:

 <SignAssembly Condition="Exists('..\xxx.pfx')">true</SignAssembly> 

Only after I deleted the line in .csproj or deleted the file on disk , then VS will be fine.

Sounds like a VS error. The version I'm using:

 Microsoft Visual Studio 2010 Version 10.0.40219.1 SP1Rel Microsoft .NET Framework Version 4.5.50709 SP1Rel 
0
source

All Articles