Failed to create a temporary class - Cryptographic failure signing assembly

I have a signed class library that I want to create for assembly through an sgen tool. However, I get an error when I try to execute the following command:

$ generated. Error: Failed to create a temporary class (result = 1).
error CS1548: cryptographic failure while signing assembly '[... path ...] \ TestSign.XmlSerializers.dll' - Assembly assembly error - - Invalid parameter.

If you need more help, enter "sgen /?".

I checked the error on MSDN which says that

CS1548 occurs when a signature fails. This is usually due to an invalid key file name, an invalid key file path, or a damaged key file.

However, I just created the key, the path is correct and, as far as I know, Visual Studio 2010 does not create damaged keys.

This problem is fairly easy to reproduce.

  • Using the code inserted here , create a new class library.
  • Create two classes: one class TestSigningand oneclass Model
  • go to project properties> Sign and check "Sign this assembly"
  • create a new file with a strong name
  • open command line Visual Studio (2010)
  • find the dll and run sgen /a:<dllname> [... as above ...]

- - . , sgen , .

, . , , SO, "header" unable to generate temporary class, , Cryptographic failure ( ).

+5
2

, . sgen, Visual Studio.

:

  • -
  • -
  • -
  • -
  • ""
  • " "
  • * edit nnn.csproj **
  • -

    <PropertyGroup>
        <SGenUseProxyTypes>false</SGenUseProxyTypes>
        <SGenPlatformTarget>$(Platform)</SGenPlatformTarget>
    </PropertyGroup>
    
  • .

+3

- . , / .

Visual Studio .

: Gordon 3log

+1

All Articles