Closed Astimus closed 6 years ago
The tool does not officially support signing .NET Core assemblies. PR is welcome if anyone wants to add this support.
The thing is that using the GUI tool to sign them and adding them as reference works. It does not work using the nuget package. Just my two cents...
I really need this as well.
Currently just trying to sign a .NET Framework project that references a .NET Standard 1.6 class library, which I think is a very valid use case scenario and highly critical.
It could seem as if this could be resolved by just updating Mono.Cecil
@brutaldev?
@ffMathy There is a branch for the latest version of mono-cecil, however, they have internal file locking issues which make the unit tests fail as well as large signing batches not being able to complete.
Alright. Is there an issue where progress on fixing that can be tracked or subscribed to?
I'm getting this error on .Net Framework assemblies, it signs successfully but then outputs errors
Operation is not valid due to the current state of the object. at Mono.Cecil.ModuleDefinition.ProcessDebugHeader() at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader) at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters) at Mono.Cecil.ModuleReader.CreateModuleFrom(Image image, ReaderParameters parameters) at Mono.Cecil.ModuleDefinition.ReadModule(Stream stream, ReaderParameters parameters) at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters) at Brutal.Dev.StrongNameSigner.SigningHelper.GetAssemblyInfo(String assemblyPath, String[] probingPaths) at Brutal.Dev.StrongNameSigner.AutomaticBuildTask.Execute()
@paul-kiar Update the the latest version.
@brutaldev I'm using 2.1.4, the latest package on nuget, including the prereleases.
The libraries I attempting to sign are 4.5.2 and 4.6.1
Specifically IdentityModel.OidcClient version 2.6.0 from nuget.
Turns out it's the project settings that were changed causing the error, I removed the project changes from my project and the errors stop. I then used console app and a pre-build event to sign the libraries. My project is being built in VS 2017 15.7.2 and the project target dotnet framework is 4.7.1.
This is the code I removed from the project:
`
Console signing doesn't work with asp .core applications. There are diffrenet errors in console: "Warning: Format of the executable (.exe) or library (.dll) is invalid" "Error: Operation is not valid due to the current state of the object"