[GH-ISSUE #41] ASP core console signing problem #34

Closed
opened 2026-02-25 21:30:31 +03:00 by kerem · 13 comments
Owner

Originally created by @Astimus on GitHub (Jul 27, 2017).
Original GitHub issue: https://github.com/brutaldev/StrongNameSigner/issues/41

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"

Originally created by @Astimus on GitHub (Jul 27, 2017). Original GitHub issue: https://github.com/brutaldev/StrongNameSigner/issues/41 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"
kerem 2026-02-25 21:30:31 +03:00
Author
Owner

@brutaldev commented on GitHub (Jul 27, 2017):

The tool does not officially support signing .NET Core assemblies. PR is welcome if anyone wants to add this support.

<!-- gh-comment-id:318455117 --> @brutaldev commented on GitHub (Jul 27, 2017): The tool does not officially support signing .NET Core assemblies. PR is welcome if anyone wants to add this support.
Author
Owner

@carlescs commented on GitHub (Mar 13, 2018):

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...

<!-- gh-comment-id:372636400 --> @carlescs commented on GitHub (Mar 13, 2018): 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...
Author
Owner

@ffMathy commented on GitHub (Apr 30, 2018):

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?

<!-- gh-comment-id:385308576 --> @ffMathy commented on GitHub (Apr 30, 2018): 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?
Author
Owner

@brutaldev commented on GitHub (Apr 30, 2018):

@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.

<!-- gh-comment-id:385319349 --> @brutaldev commented on GitHub (Apr 30, 2018): @ffMathy There is a [branch for the latest version of mono-cecil](https://github.com/brutaldev/StrongNameSigner/tree/mono.cecil-0.10), however, they have internal file locking issues which make the unit tests fail as well as large signing batches not being able to complete.
Author
Owner

@ffMathy commented on GitHub (Apr 30, 2018):

Alright. Is there an issue where progress on fixing that can be tracked or subscribed to?

<!-- gh-comment-id:385337097 --> @ffMathy commented on GitHub (Apr 30, 2018): Alright. Is there an issue where progress on fixing that can be tracked or subscribed to?
Author
Owner

@paul-kiar commented on GitHub (Jun 1, 2018):

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()

<!-- gh-comment-id:393911165 --> @paul-kiar commented on GitHub (Jun 1, 2018): 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()`
Author
Owner

@brutaldev commented on GitHub (Jun 1, 2018):

@paul-kiar Update the the latest version.

<!-- gh-comment-id:393927684 --> @brutaldev commented on GitHub (Jun 1, 2018): @paul-kiar Update the the latest version.
Author
Owner

@paul-kiar commented on GitHub (Jun 1, 2018):

@brutaldev I'm using 2.1.4, the latest package on nuget, including the prereleases.

<!-- gh-comment-id:393946226 --> @paul-kiar commented on GitHub (Jun 1, 2018): @brutaldev I'm using 2.1.4, the latest package on nuget, including the prereleases.
Author
Owner

@paul-kiar commented on GitHub (Jun 1, 2018):

The libraries I attempting to sign are 4.5.2 and 4.6.1

<!-- gh-comment-id:393946382 --> @paul-kiar commented on GitHub (Jun 1, 2018): The libraries I attempting to sign are 4.5.2 and 4.6.1
Author
Owner

@paul-kiar commented on GitHub (Jun 1, 2018):

Specifically IdentityModel.OidcClient version 2.6.0 from nuget.

<!-- gh-comment-id:393946620 --> @paul-kiar commented on GitHub (Jun 1, 2018): Specifically IdentityModel.OidcClient version 2.6.0 from nuget.
Author
Owner

@paul-kiar commented on GitHub (Jun 1, 2018):

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.

<!-- gh-comment-id:393952752 --> @paul-kiar commented on GitHub (Jun 1, 2018): 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.
Author
Owner

@paul-kiar commented on GitHub (Jun 1, 2018):

This is the code I removed from the project:
<Import Project="..\..\..\packages\Brutal.Dev.StrongNameSigner.2.1.4\build\Brutal.Dev.StrongNameSigner.targets" Condition="Exists('..\..\..\packages\Brutal.Dev.StrongNameSigner.2.1.4\build\Brutal.Dev.StrongNameSigner.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\..\..\packages\Brutal.Dev.StrongNameSigner.2.1.4\build\Brutal.Dev.StrongNameSigner.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Brutal.Dev.StrongNameSigner.2.1.4\build\Brutal.Dev.StrongNameSigner.targets'))" /> </Target>

<!-- gh-comment-id:393962091 --> @paul-kiar commented on GitHub (Jun 1, 2018): This is the code I removed from the project: ` <Import Project="..\..\..\packages\Brutal.Dev.StrongNameSigner.2.1.4\build\Brutal.Dev.StrongNameSigner.targets" Condition="Exists('..\..\..\packages\Brutal.Dev.StrongNameSigner.2.1.4\build\Brutal.Dev.StrongNameSigner.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\..\..\packages\Brutal.Dev.StrongNameSigner.2.1.4\build\Brutal.Dev.StrongNameSigner.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Brutal.Dev.StrongNameSigner.2.1.4\build\Brutal.Dev.StrongNameSigner.targets'))" /> </Target>`
Author
Owner

@brutaldev commented on GitHub (Aug 28, 2018):

This could be attempted again using v2.2.0.

A similar issue was found in issue #47 which was corrected in the latest update.

<!-- gh-comment-id:416728315 --> @brutaldev commented on GitHub (Aug 28, 2018): This could be attempted again using [v2.2.0](https://github.com/brutaldev/StrongNameSigner/releases/tag/v2.2.0). A similar issue was found in issue #47 which was corrected in the latest update.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/StrongNameSigner#34
No description provided.