[GH-ISSUE #82] Failed to resolve assembly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' #67

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

Originally created by @kirillkovalenko on GitHub (Dec 27, 2022).
Original GitHub issue: https://github.com/brutaldev/StrongNameSigner/issues/82

Originally assigned to: @brutaldev on GitHub.

What could that error be?

~\.nuget\packages\brutal.dev.strongnamesigner\3.2.1\build\StrongNameSigner.Console.exe -a c:\users\kirill\.nuget\packages\ntapidotnet\1.1.33\lib\net461\NtApiDotNet.dll

-----------------------------------------------------------
---- Brutal Developer .NET Assembly Strong-Name Signer ----
-----------------------------------------------------------
Console application to sign .NET assemblies with a strong-name key and fix assembly references.
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
   at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
   at Mono.Cecil.DefaultAssemblyResolver.Resolve(AssemblyNameReference name)
   at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
   at Mono.Cecil.TypeReference.Resolve()
   at Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
   at Mono.Cecil.SignatureReader.ReadCustomAttributeEnum(TypeReference enum_type)
   at Mono.Cecil.SignatureReader.ReadCustomAttributeElement(TypeReference type)
   at Mono.Cecil.SignatureReader.ReadCustomAttributeConstructorArguments(CustomAttribute attribute, Collection`1 parameters)
   at Mono.Cecil.MetadataReader.ReadCustomAttributeSignature(CustomAttribute attribute)
   at Mono.Cecil.CustomAttribute.<Resolve>b__35_0(CustomAttribute attribute, MetadataReader reader)
   at Mono.Cecil.ModuleDefinition.Read[TItem](TItem item, Action`2 read)
   at Mono.Cecil.CustomAttribute.Resolve()
   at Mono.Cecil.CustomAttribute.get_ConstructorArguments()
   at Mono.Cecil.ImmediateModuleReader.ReadCustomAttributes(ICustomAttributeProvider provider)
   at Mono.Cecil.ImmediateModuleReader.ReadMethods(TypeDefinition type)
   at Mono.Cecil.ImmediateModuleReader.ReadType(TypeDefinition type)
   at Mono.Cecil.ImmediateModuleReader.ReadTypes(Collection`1 types)
   at Mono.Cecil.ImmediateModuleReader.ReadModule(ModuleDefinition module, Boolean resolve_attributes)
   at Mono.Cecil.ModuleDefinition.Read[TItem](TItem item, Action`2 read)
   at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters)
   at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
   at Brutal.Dev.StrongNameSigner.AssemblyInfo..ctor(String assemblyPath, String[] probingPaths)
   at Brutal.Dev.StrongNameSigner.SigningHelper.SignAssemblies(IEnumerable`1 assemblyInputOutputPaths, String keyFilePath, String keyFilePassword, String[] probingPaths)
Originally created by @kirillkovalenko on GitHub (Dec 27, 2022). Original GitHub issue: https://github.com/brutaldev/StrongNameSigner/issues/82 Originally assigned to: @brutaldev on GitHub. What could that error be? `~\.nuget\packages\brutal.dev.strongnamesigner\3.2.1\build\StrongNameSigner.Console.exe -a c:\users\kirill\.nuget\packages\ntapidotnet\1.1.33\lib\net461\NtApiDotNet.dll` ``` ----------------------------------------------------------- ---- Brutal Developer .NET Assembly Strong-Name Signer ---- ----------------------------------------------------------- Console application to sign .NET assemblies with a strong-name key and fix assembly references. Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters) at Mono.Cecil.DefaultAssemblyResolver.Resolve(AssemblyNameReference name) at Mono.Cecil.MetadataResolver.Resolve(TypeReference type) at Mono.Cecil.TypeReference.Resolve() at Mono.Cecil.Mixin.CheckedResolve(TypeReference self) at Mono.Cecil.SignatureReader.ReadCustomAttributeEnum(TypeReference enum_type) at Mono.Cecil.SignatureReader.ReadCustomAttributeElement(TypeReference type) at Mono.Cecil.SignatureReader.ReadCustomAttributeConstructorArguments(CustomAttribute attribute, Collection`1 parameters) at Mono.Cecil.MetadataReader.ReadCustomAttributeSignature(CustomAttribute attribute) at Mono.Cecil.CustomAttribute.<Resolve>b__35_0(CustomAttribute attribute, MetadataReader reader) at Mono.Cecil.ModuleDefinition.Read[TItem](TItem item, Action`2 read) at Mono.Cecil.CustomAttribute.Resolve() at Mono.Cecil.CustomAttribute.get_ConstructorArguments() at Mono.Cecil.ImmediateModuleReader.ReadCustomAttributes(ICustomAttributeProvider provider) at Mono.Cecil.ImmediateModuleReader.ReadMethods(TypeDefinition type) at Mono.Cecil.ImmediateModuleReader.ReadType(TypeDefinition type) at Mono.Cecil.ImmediateModuleReader.ReadTypes(Collection`1 types) at Mono.Cecil.ImmediateModuleReader.ReadModule(ModuleDefinition module, Boolean resolve_attributes) at Mono.Cecil.ModuleDefinition.Read[TItem](TItem item, Action`2 read) at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters) at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters) at Brutal.Dev.StrongNameSigner.AssemblyInfo..ctor(String assemblyPath, String[] probingPaths) at Brutal.Dev.StrongNameSigner.SigningHelper.SignAssemblies(IEnumerable`1 assemblyInputOutputPaths, String keyFilePath, String keyFilePassword, String[] probingPaths) ```
kerem 2026-02-25 21:30:35 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@kirillkovalenko commented on GitHub (Dec 27, 2022):

Just found out that it does work with 3.2.0. So it must be a regression.

<!-- gh-comment-id:1366020043 --> @kirillkovalenko commented on GitHub (Dec 27, 2022): Just found out that it does work with 3.2.0. So it must be a regression.
Author
Owner

@brutaldev commented on GitHub (Dec 30, 2022):

@kirillkovalenko Unfortuantely I cannot reproduce this:

-------------------------------------------------------------------
---- Brutal Developer .NET Assembly Strong-Name Signer 3.2.1.0 ----
-------------------------------------------------------------------
Console application to sign .NET assemblies with a strong-name key and fix assembly references.
Checking assembly references in 'C:\Users\werne\.nuget\packages\ntapidotnet\1.1.33\lib\net461\NtApiDotNet.dll'.
Signing assembly 'C:\Users\werne\.nuget\packages\ntapidotnet\1.1.33\lib\net461\NtApiDotNet.dll'.
Saving changes to assembly 'C:\Users\werne\.nuget\packages\ntapidotnet\1.1.33\lib\net461\NtApiDotNet.dll'.
<!-- gh-comment-id:1368063804 --> @brutaldev commented on GitHub (Dec 30, 2022): @kirillkovalenko Unfortuantely I cannot reproduce this: ```` ------------------------------------------------------------------- ---- Brutal Developer .NET Assembly Strong-Name Signer 3.2.1.0 ---- ------------------------------------------------------------------- Console application to sign .NET assemblies with a strong-name key and fix assembly references. Checking assembly references in 'C:\Users\werne\.nuget\packages\ntapidotnet\1.1.33\lib\net461\NtApiDotNet.dll'. Signing assembly 'C:\Users\werne\.nuget\packages\ntapidotnet\1.1.33\lib\net461\NtApiDotNet.dll'. Saving changes to assembly 'C:\Users\werne\.nuget\packages\ntapidotnet\1.1.33\lib\net461\NtApiDotNet.dll'. ````
Author
Owner

@DanAvni commented on GitHub (Jan 15, 2023):

I am having the same issue

`
------ Build started: Project: Base, Configuration: Debug x86 ------
Restoring NuGet packages...
To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
All packages listed in packages.config are already installed.

---- Brutal Developer .NET Assembly Strong-Name Signer 3.3.2.0 ----

Console application to sign .NET assemblies with a strong-name key and fix assembly references.

  1. Loading assemblies...
  2. Checking assembly references...
    Checking assembly references in 'D:\Develop\Project\packages\GeoTimeZone.5.2.0\lib\net462\GeoTimeZone.dll'.
  3. Strong-name unsigned assemblies...
  4. Fix InternalVisibleToAttribute references...
  5. Fix CustomAttributes with Type references...
  6. Cleanup...
    Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
    at Mono.Cecil.DefaultAssemblyResolver.Resolve(AssemblyNameReference name)
    at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
    at Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
    at Mono.Cecil.SignatureReader.ReadCustomAttributeEnum(TypeReference enum_type)
    at Mono.Cecil.SignatureReader.ReadCustomAttributeElement(TypeReference type)
    at Mono.Cecil.SignatureReader.ReadCustomAttributeConstructorArguments(CustomAttribute attribute, Collection1 parameters) at Mono.Cecil.MetadataReader.ReadCustomAttributeSignature(CustomAttribute attribute) at Mono.Cecil.CustomAttribute.<Resolve>b__35_0(CustomAttribute attribute, MetadataReader reader) at Mono.Cecil.ModuleDefinition.Read[TItem](TItem item, Action2 read)
    at Mono.Cecil.CustomAttribute.Resolve()
    at Mono.Cecil.CustomAttribute.get_HasConstructorArguments()
    at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
    at Brutal.Dev.StrongNameSigner.SigningHelper.SignAssemblies(IEnumerable1 assemblyInputOutputPaths, String keyFilePath, String keyFilePassword, String[] probingPaths) at Brutal.Dev.StrongNameSigner.Console.Program.SignAssemblies(Options options) at Brutal.Dev.StrongNameSigner.Console.Program.Main(String[] args) D:\Develop\Project\Libraries\Base\Base.vbproj(2619,5): error MSB3073: The command ""D:\Develop\Project\packages\Brutal.Dev.StrongNameSigner.3.3.2\build\StrongNameSigner.Console.exe" -in "..\..\packages\GeoTimeZone*\*\net462"" exited with code 1.

The assembly does get signed but during cleanup something fails

<!-- gh-comment-id:1383194578 --> @DanAvni commented on GitHub (Jan 15, 2023): I am having the same issue ` ------ Build started: Project: Base, Configuration: Debug x86 ------ Restoring NuGet packages... To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'. All packages listed in packages.config are already installed. ------------------------------------------------------------------- ---- Brutal Developer .NET Assembly Strong-Name Signer 3.3.2.0 ---- ------------------------------------------------------------------- Console application to sign .NET assemblies with a strong-name key and fix assembly references. 1. Loading assemblies... 2. Checking assembly references... Checking assembly references in 'D:\Develop\Project\packages\GeoTimeZone.5.2.0\lib\net462\GeoTimeZone.dll'. 3. Strong-name unsigned assemblies... 4. Fix InternalVisibleToAttribute references... 5. Fix CustomAttributes with Type references... 6. Cleanup... Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters) at Mono.Cecil.DefaultAssemblyResolver.Resolve(AssemblyNameReference name) at Mono.Cecil.MetadataResolver.Resolve(TypeReference type) at Mono.Cecil.Mixin.CheckedResolve(TypeReference self) at Mono.Cecil.SignatureReader.ReadCustomAttributeEnum(TypeReference enum_type) at Mono.Cecil.SignatureReader.ReadCustomAttributeElement(TypeReference type) at Mono.Cecil.SignatureReader.ReadCustomAttributeConstructorArguments(CustomAttribute attribute, Collection`1 parameters) at Mono.Cecil.MetadataReader.ReadCustomAttributeSignature(CustomAttribute attribute) at Mono.Cecil.CustomAttribute.<Resolve>b__35_0(CustomAttribute attribute, MetadataReader reader) at Mono.Cecil.ModuleDefinition.Read[TItem](TItem item, Action`2 read) at Mono.Cecil.CustomAttribute.Resolve() at Mono.Cecil.CustomAttribute.get_HasConstructorArguments() at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at Brutal.Dev.StrongNameSigner.SigningHelper.SignAssemblies(IEnumerable`1 assemblyInputOutputPaths, String keyFilePath, String keyFilePassword, String[] probingPaths) at Brutal.Dev.StrongNameSigner.Console.Program.SignAssemblies(Options options) at Brutal.Dev.StrongNameSigner.Console.Program.Main(String[] args) D:\Develop\Project\Libraries\Base\Base.vbproj(2619,5): error MSB3073: The command ""D:\Develop\Project\packages\Brutal.Dev.StrongNameSigner.3.3.2\build\StrongNameSigner.Console.exe" -in "..\..\packages\GeoTimeZone*\*\net462"" exited with code 1. ` The assembly *does* get signed but during cleanup something fails
Author
Owner

@brutaldev commented on GitHub (Jan 15, 2023):

Created a .NET 4.6.2 console app and added GeoTimeZone.5.2.0 through NuGet and used the same console app arguments to sign it without any errors. I even just added the strong name signer NuGet package and running the build signs everything (all versions).

Do you have a sample project this happens on @DanAvni ?

<!-- gh-comment-id:1383235676 --> @brutaldev commented on GitHub (Jan 15, 2023): Created a .NET 4.6.2 console app and added GeoTimeZone.5.2.0 through NuGet and used the same console app arguments to sign it without any errors. I even just added the strong name signer NuGet package and running the build signs everything (all versions). Do you have a sample project this happens on @DanAvni ?
Author
Owner

@DanAvni commented on GitHub (Jan 16, 2023):

@brutaldev , when trying to create a sample project it worked so I have no idea what causes this on my solution but I did solve this by turning off the auto build and just including a call on BeforeBuild to the StrongName console to sign GeoTimeZone

<!-- gh-comment-id:1383540055 --> @DanAvni commented on GitHub (Jan 16, 2023): @brutaldev , when trying to create a sample project it worked so I have no idea what causes this on my solution but I did solve this by turning off the auto build and just including a call on BeforeBuild to the StrongName console to sign GeoTimeZone
Author
Owner

@brutaldev commented on GitHub (Jan 21, 2023):

Found this to be the new feature that fixes custom attributes and sometimes it cannot resolve the types. Added handling around that so this is fixed up in v3.3.3 - github.com/brutaldev/StrongNameSigner@7daf2405e7

<!-- gh-comment-id:1399319075 --> @brutaldev commented on GitHub (Jan 21, 2023): Found this to be the new feature that fixes custom attributes and sometimes it cannot resolve the types. Added handling around that so this is fixed up in [v3.3.3](https://github.com/brutaldev/StrongNameSigner/releases/tag/v3.3.3) - https://github.com/brutaldev/StrongNameSigner/commit/7daf2405e73ab6406e7e019b7440235b5002231a
Author
Owner

@janis-veinbergs commented on GitHub (Sep 5, 2023):

Using 3.3.3 and having exact/similar issue?

Cannot resolve builtin System assembly? Why so? I'm doing this via command line:

. ".\packages\brutal.dev.strongnamesigner\3.3.3\build\StrongNameSigner.Console.exe" -in ".\packages\libphonenumbers-dotnet\1.1.0\lib\net45" -k "Key.snk"

And getting:

7. Save assembly changes...
   Saving changes to assembly '.\packages\libphonenumbers-dotnet\1.1.0\lib\net45\libphonenumbers-dotnet.dll'.
   Failed to save assembly '.\packages\libphonenumbers-dotnet\1.1.0\lib\net45\libphonenumbers-dotnet.dll': Failed to resolve assembly: 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Seems System.dll was loaded at some point, but within save operation it searches within funky paths but not within GAC:
procmon

Previously was using libphonenumber-csharp and it was complaining about not resolving netstandard.dll. I thought StrognNameSigned won't support netstandard, but looks like i'm out of luck against this lib too.

I am already long time user of StrongNameSigner and other projects are good.

However I'm now using .sdk style project and targeting net462... but I tried adding this .dll to be signed in a non-SDK style .net462 project and it still fails.

Downgraded to 3.2.0 and it also fails with same error, however the .unsigned file pops up :) But original .dll left unsigned.

<!-- gh-comment-id:1706399921 --> @janis-veinbergs commented on GitHub (Sep 5, 2023): Using 3.3.3 and having exact/similar issue? Cannot resolve builtin System assembly? Why so? I'm doing this via command line: ``` . ".\packages\brutal.dev.strongnamesigner\3.3.3\build\StrongNameSigner.Console.exe" -in ".\packages\libphonenumbers-dotnet\1.1.0\lib\net45" -k "Key.snk" ``` And getting: ``` 7. Save assembly changes... Saving changes to assembly '.\packages\libphonenumbers-dotnet\1.1.0\lib\net45\libphonenumbers-dotnet.dll'. Failed to save assembly '.\packages\libphonenumbers-dotnet\1.1.0\lib\net45\libphonenumbers-dotnet.dll': Failed to resolve assembly: 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' ```` Seems System.dll was loaded at some point, but within save operation it searches within funky paths but not within GAC: ![procmon](https://github.com/brutaldev/StrongNameSigner/assets/714667/81e3b135-0d01-4d37-9fcd-ad7e1de21f92) Previously was using libphonenumber-csharp and it was complaining about not resolving netstandard.dll. I thought StrognNameSigned won't support netstandard, but looks like i'm out of luck against this lib too. I am already long time user of StrongNameSigner and other projects are good. However I'm now using .sdk style project and targeting net462... but I tried adding this .dll to be signed in a non-SDK style .net462 project and it still fails. Downgraded to 3.2.0 and it also fails with same error, however the .unsigned file pops up :) But original .dll left unsigned.
Author
Owner

@kirillkovalenko commented on GitHub (Sep 6, 2023):

Using 3.3.3 and having exact/similar issue?
Yes, it has.

<!-- gh-comment-id:1708922942 --> @kirillkovalenko commented on GitHub (Sep 6, 2023): > Using 3.3.3 and having exact/similar issue? Yes, it has.
Author
Owner

@kirillkovalenko commented on GitHub (Nov 13, 2023):

The issue manifests itself with all the latest versions: 3.2.0, 3.3.3 and 3.4.0

3>-------------------------------------------------------------------
3>---- Brutal Developer .NET Assembly Strong-Name Signer 3.4.0.0 ----
3>-------------------------------------------------------------------
3>Console application to sign .NET assemblies with a strong-name key and fix assembly references.
3>1. Loading assemblies...
3>2. Checking assembly references...
3>  Checking assembly references in 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll'.
3>3. Strong-name unsigned assemblies...
3>   Signing assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll'.
3>4. Fix InternalVisibleToAttribute references...
3> Removing invalid friend reference from assembly 'C:\Users\kyrylo\AppData\Local\Temp\StrongNameSigner-ab528ee8-110c-4f80-bc72-ac1292136fdb\TBC.Common.Configuration.Registry.8b5e10a0-a129-4490-9cb8-bc06a214ce30.dll'.
3>5. Fix CustomAttributes with Type references...
3> Failed to check custom attribute 'System.Diagnostics.DebuggableAttribute' in assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll': Failed to resolve assembly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
3>6. Fix BAML references...
3>7. Save assembly changes...
3> Saving changes to assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll'.
3> Failed to save assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll': Failed to resolve assembly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
3>8. Cleanup...

I'm using VS 2022 on windows server 2022.

<!-- gh-comment-id:1808405240 --> @kirillkovalenko commented on GitHub (Nov 13, 2023): The issue manifests itself with all the latest versions: 3.2.0, 3.3.3 and 3.4.0 ``` 3>------------------------------------------------------------------- 3>---- Brutal Developer .NET Assembly Strong-Name Signer 3.4.0.0 ---- 3>------------------------------------------------------------------- 3>Console application to sign .NET assemblies with a strong-name key and fix assembly references. 3>1. Loading assemblies... 3>2. Checking assembly references... 3> Checking assembly references in 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll'. 3>3. Strong-name unsigned assemblies... 3> Signing assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll'. 3>4. Fix InternalVisibleToAttribute references... 3> Removing invalid friend reference from assembly 'C:\Users\kyrylo\AppData\Local\Temp\StrongNameSigner-ab528ee8-110c-4f80-bc72-ac1292136fdb\TBC.Common.Configuration.Registry.8b5e10a0-a129-4490-9cb8-bc06a214ce30.dll'. 3>5. Fix CustomAttributes with Type references... 3> Failed to check custom attribute 'System.Diagnostics.DebuggableAttribute' in assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll': Failed to resolve assembly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 3>6. Fix BAML references... 3>7. Save assembly changes... 3> Saving changes to assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll'. 3> Failed to save assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll': Failed to resolve assembly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 3>8. Cleanup... ``` I'm using VS 2022 on windows server 2022.
Author
Owner

@brutaldev commented on GitHub (Nov 13, 2023):

@kirillkovalenko Please provide a link to a sample project that replicates this issue or add a unit test that shows the failure because I cannot reproduce it.

<!-- gh-comment-id:1808513706 --> @brutaldev commented on GitHub (Nov 13, 2023): @kirillkovalenko Please provide a link to a sample project that replicates this issue or add a unit test that shows the failure because I cannot reproduce it.
Author
Owner

@kirillkovalenko commented on GitHub (Nov 13, 2023):

Here is a simple script that reproduces the issue on several machines in my lab

@echo off

rem TODO: maybe update nuget.exe PATH
set nuget=nuget.exe
%nuget% install TBC.Common.Configuration.Registry -Version 1.5.0
%nuget% install brutal.dev.strongnamesigner -Version 3.4.0

rem TODO: maybe update the path to sn.exe
rem set sn="C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\sn.exe" 
set sn="C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8.1 Tools\x64\sn.exe"
set key=%TEMP%\issue82.snk
%sn% -k %key%

set ssc=%USERPROFILE%\.nuget\packages\brutal.dev.strongnamesigner\3.4.0\build\StrongNameSigner.Console.exe
set dll=%USERPROFILE%\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll

%ssc% -a %dll% -k %key%

and here is a log file

.\Issue82.cmd
Feeds used:
  C:\Users\kyrylo\.nuget\packages\
  https://api.nuget.org/v3/index.json
  C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

Package "TBC.Common.Configuration.Registry.1.5.0" is already installed.
Feeds used:
  C:\Users\kyrylo\.nuget\packages\
  https://api.nuget.org/v3/index.json
  C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

Package "brutal.dev.strongnamesigner.3.4.0" is already installed.

Microsoft (R) .NET Framework Strong Name Utility  Version 4.0.30319.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Key pair written to C:\Users\kyrylo\AppData\Local\Temp\2\issue82.snk
-------------------------------------------------------------------
---- Brutal Developer .NET Assembly Strong-Name Signer 3.4.0.0 ----
-------------------------------------------------------------------
Console application to sign .NET assemblies with a strong-name key and fix assembly references.
1. Loading assemblies...
2. Checking assembly references...
   Checking assembly references in 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll'.
3. Strong-name unsigned assemblies...
   Signing assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll'.
4. Fix InternalVisibleToAttribute references...
   Removing invalid friend reference from assembly 'C:\Users\kyrylo\AppData\Local\Temp\2\StrongNameSigner-19fac6c1-50ed-49f2-a4b8-e1447f3c855f\TBC.Common.Configuration.Registry.7ed0eec7-26b5-45d6-9414-2a4bf6d73e04.dll'.
5. Fix CustomAttributes with Type references...
   Failed to check custom attribute 'System.Diagnostics.DebuggableAttribute' in assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll': Failed to resolve assemb
ly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
6. Fix BAML references...
7. Save assembly changes...
   Saving changes to assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll'.
   Failed to save assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll': Failed to resolve assembly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToke
n=b77a5c561934e089'
8. Cleanup...
<!-- gh-comment-id:1808595141 --> @kirillkovalenko commented on GitHub (Nov 13, 2023): Here is a simple script that reproduces the issue on several machines in my lab ```cmd @echo off rem TODO: maybe update nuget.exe PATH set nuget=nuget.exe %nuget% install TBC.Common.Configuration.Registry -Version 1.5.0 %nuget% install brutal.dev.strongnamesigner -Version 3.4.0 rem TODO: maybe update the path to sn.exe rem set sn="C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\sn.exe" set sn="C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8.1 Tools\x64\sn.exe" set key=%TEMP%\issue82.snk %sn% -k %key% set ssc=%USERPROFILE%\.nuget\packages\brutal.dev.strongnamesigner\3.4.0\build\StrongNameSigner.Console.exe set dll=%USERPROFILE%\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll %ssc% -a %dll% -k %key% ``` and here is a log file ``` .\Issue82.cmd Feeds used: C:\Users\kyrylo\.nuget\packages\ https://api.nuget.org/v3/index.json C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\ Package "TBC.Common.Configuration.Registry.1.5.0" is already installed. Feeds used: C:\Users\kyrylo\.nuget\packages\ https://api.nuget.org/v3/index.json C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\ Package "brutal.dev.strongnamesigner.3.4.0" is already installed. Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.0 Copyright (c) Microsoft Corporation. All rights reserved. Key pair written to C:\Users\kyrylo\AppData\Local\Temp\2\issue82.snk ------------------------------------------------------------------- ---- Brutal Developer .NET Assembly Strong-Name Signer 3.4.0.0 ---- ------------------------------------------------------------------- Console application to sign .NET assemblies with a strong-name key and fix assembly references. 1. Loading assemblies... 2. Checking assembly references... Checking assembly references in 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll'. 3. Strong-name unsigned assemblies... Signing assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll'. 4. Fix InternalVisibleToAttribute references... Removing invalid friend reference from assembly 'C:\Users\kyrylo\AppData\Local\Temp\2\StrongNameSigner-19fac6c1-50ed-49f2-a4b8-e1447f3c855f\TBC.Common.Configuration.Registry.7ed0eec7-26b5-45d6-9414-2a4bf6d73e04.dll'. 5. Fix CustomAttributes with Type references... Failed to check custom attribute 'System.Diagnostics.DebuggableAttribute' in assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll': Failed to resolve assemb ly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 6. Fix BAML references... 7. Save assembly changes... Saving changes to assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll'. Failed to save assembly 'C:\Users\kyrylo\.nuget\packages\tbc.common.configuration.registry\1.5.0\lib\net471\TBC.Common.Configuration.Registry.dll': Failed to resolve assembly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToke n=b77a5c561934e089' 8. Cleanup... ```
Author
Owner

@brutaldev commented on GitHub (Feb 5, 2024):

Fix in 3.5.0: https://github.com/brutaldev/StrongNameSigner/releases/tag/v3.5.0

<!-- gh-comment-id:1926740580 --> @brutaldev commented on GitHub (Feb 5, 2024): Fix in 3.5.0: https://github.com/brutaldev/StrongNameSigner/releases/tag/v3.5.0
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#67
No description provided.