Strong naming assembly using command line compilation

I am trying to use NAnt to compile and sign an assembly using the vbc compiler. I have a project and I can successfully sign the assembly assembly using VS2010. When I try to sign it using the command line, I get this error:

vbc : error BC30140: Error creating assembly manifest: Error signing assembly -- The parameter is incorrect.

I even created a trivially simple application (just an assemblyinfo.vb file) that does not compile and does not sign using vbc.exe. What am I doing wrong?

here is my assemblyinfo.vb:

Option Strict Off
Option Explicit On

Imports System
Imports System.Reflection
<Assembly: AssemblyVersionAttribute("2010.05.18.0918"),  _
 Assembly: AssemblyCopyrightAttribute("Copyright © Patient First 2007"),  _
 Assembly: AssemblyCompanyAttribute("Patient First, Inc."),  _
 Assembly: AssemblyProductAttribute("Patient First Framework"),  _
 Assembly: AssemblyDelaySign(false),  _
 Assembly: AssemblyKeyFile("test.pfx"), _
 Assembly: AssemblyTitleAttribute("PatientFirst.Framework")>

test.pfx is located in the same folder as assemblyinfo.vb

This is how I try to compile it:

vbc /target:library /verbose assemblyinfo.vb

I also tried using

vbc /target:library /verbose assemblyinfo.vb /keyfile:test.pfx

and tried to use the / keyfile option without the AssemblyDelaySign and AssemblyKeyFile attributes

AssemblyDelaySign AssemblyKeyFile /keyfile, . vbc?

- EDIT: , MSBuild AssemblyKeyFile, AssemblyInfo.vb, . , , , - , , .

- EDIT: , VS2010, , msbuild /keycontainer vbc.exe /keyfile. , /keyfile.

+3
1

, MSBuild AssemblyKeyFile, AssemblyInfo.vb, . , , , - , , .

VS2010, , msbuild /keycontainer vbc.exe /keyfile. , /keyfile.

+1

Source: https://habr.com/ru/post/1745993/


All Articles