[GH-ISSUE #83] Fixing unsigned references in signed assemblies when signing unsigned assemblies - unhandled case? #68

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

Originally created by @HiddenDude on GitHub (Jan 4, 2023).
Original GitHub issue: https://github.com/brutaldev/StrongNameSigner/issues/83

Originally assigned to: @brutaldev on GitHub.

Hello,

I'm trying to use the strong name signer on a C# project made with the "DYMO.Connect.SDK" NuGet package.
(from https://www.nuget.org/packages/DYMO.Connect.SDK/ , its a label printer SDK )
(that package contains a mix of signed and unsigned DLLs, e.g. in the current version = 1.4.3.37)
(& I'm targeting .NET Framework 4.7.2 in case you need to know for possible testing with the package)

When using the StrongNameSigner NuGet package, the build task doesn't seem to catch all output DLLs.
(some DLLs in the output directory stay unsigned, even though they are referenced somewhere in the dependency tree)

I've also had some problems trying to sign the DLLs by hand with the GUI/CmdLine tool..
Some don't get added to the list at all (GUI) without an error.. And for some there are problems finding referenced assemblies.
(it could be somehow related..? or VS just knows about additional dependant package paths and the manual tools don't..?)

I've mostly already worked around my problem by not signing my class library project and manually renaming a file (DymoSDK.dll.unsigned => DymoSDK.dll) in the NuGet package - that way everything stays unsigned (except for a few calls from unsigned code to signed code which seems to be allowed) and my application doesn't complain.

It would be nice if the strong name signer could even fix shit like the DYMO.Connect.SDK.
(it has already cost me hours)

I suspect the SDK has a reference to an unsigned DLL within an actually signed DLL thats not updated because the tool doesn't touch signed assemblies..?

Let me know if you need more detailed input. I'd have to "break" my project and check the DLLs' dependencies again to know what exactly wasn't correctly signed / updated with the strong name signer build process task.

Originally created by @HiddenDude on GitHub (Jan 4, 2023). Original GitHub issue: https://github.com/brutaldev/StrongNameSigner/issues/83 Originally assigned to: @brutaldev on GitHub. Hello, **I'm trying to use the strong name signer on a C# project made with the "DYMO.Connect.SDK" NuGet package.** (from https://www.nuget.org/packages/DYMO.Connect.SDK/ , its a label printer SDK ) (that package contains a mix of signed and unsigned DLLs, e.g. in the current version = 1.4.3.37) (& I'm targeting .NET Framework 4.7.2 in case you need to know for possible testing with the package) **When using the StrongNameSigner NuGet package, the build task doesn't seem to catch all output DLLs.** **(some DLLs in the output directory stay unsigned, even though they are referenced somewhere in the dependency tree)** I've also had some problems trying to sign the DLLs by hand with the GUI/CmdLine tool.. Some don't get added to the list at all (GUI) without an error.. And for some there are problems finding referenced assemblies. (it could be somehow related..? or VS just knows about additional dependant package paths and the manual tools don't..?) I've mostly already worked around my problem by not signing my class library project and manually renaming a file (DymoSDK.dll.unsigned => DymoSDK.dll) in the NuGet package - that way everything stays unsigned (except for a few calls from unsigned code to signed code which seems to be allowed) and my application doesn't complain. **It would be nice if the strong name signer could even fix shit like the DYMO.Connect.SDK.** (it has already cost me hours) I suspect the SDK has a reference to an unsigned DLL within an actually signed DLL thats not updated because the tool doesn't touch signed assemblies..? Let me know if you need more detailed input. I'd have to "break" my project and check the DLLs' dependencies again to know what exactly wasn't correctly signed / updated with the strong name signer build process task.
kerem closed this issue 2026-02-25 21:30:35 +03:00
Author
Owner

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

Please provide the log output from the signing process. You can also provide the log output when using the user interface/console application for the assemblies that get ignored (mixed-mode or native I suspect).

Do you have a sample project or is it just a basic project that brings in the DYMO.Connect.SDK NuGet package?

I've mostly already worked around my problem by not signing my class library project

Why not just leave things unsigned, is there is a specific reason you need to actually strong-name sign your project?
Unsigned assemblies can use signed assemblies but not the other way around (which is what this tool was created for). If you do not need to sign your own stuff then don't worry about trying to sign others.

<!-- gh-comment-id:1370586713 --> @brutaldev commented on GitHub (Jan 4, 2023): Please provide the log output from the signing process. You can also provide the log output when using the user interface/console application for the assemblies that get ignored (mixed-mode or native I suspect). Do you have a sample project or is it just a basic project that brings in the DYMO.Connect.SDK NuGet package? > I've mostly already worked around my problem by not signing my class library project Why not just leave things unsigned, is there is a specific reason you need to actually strong-name sign your project? Unsigned assemblies can use signed assemblies but not the other way around (which is what this tool was created for). If you do not need to sign your own stuff then don't worry about trying to sign others.
Author
Owner

@HiddenDude commented on GitHub (Jan 4, 2023):

I have made a quick VS2022 sample project for it and attached it.
(but I had to exclude the actual packages from the zip because of upload size limitations, but they are fresh from the store)

DYMOSDKSampleForSNS.zip

Just a basic .NET Framework class library targeting .NET Framework 4.7.2 with the "DYMO.Connect.SDK" (+ dependencies) and "Brutal.Dev.StrongNameSigner" NuGet packages added, and maybe some short code to initialize the SDK.

The output directory looks complete like that and reproduces the error in my application.

The log from the build process (including SNS notifications) is this - is this log sufficient or did I miss anything?:

------ Build started: Project: DYMOSDKSampleForSNS, Configuration: Debug Any CPU ------
  -- Starting Brutal Developer .NET Assembly Strong-Name Signer Task --
  Adding 'C:\Users\user\Desktop\Projects\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\lib\netstandard2.0\DymoSDK.dll' for processing.
  Adding 'C:\Users\user\Desktop\Projects\DYMOSDKSampleForSNS\packages\SkiaSharp.1.68.0\lib\net45\SkiaSharp.dll' for processing.
  Checking assembly references in 'C:\Users\user\Desktop\Projects\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\lib\netstandard2.0\DymoSDK.dll'.
  Checking assembly references in 'C:\Users\user\Desktop\Projects\DYMOSDKSampleForSNS\packages\SkiaSharp.1.68.0\lib\net45\SkiaSharp.dll'.
  -- Finished Brutal Developer .NET Assembly Strong-Name Signer Task in 00:00:00.7031904 -- 
  DYMOSDKSampleForSNS -> C:\Users\user\Desktop\Projects\DYMOSDKSampleForSNS\DYMOSDKSampleForSNS\bin\Debug\DYMOSDKSampleForSNS.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Elapsed 00:01,503 ==========

It looks like the StrongNameSigner is not even doing that much there.
(the 2 DLLs that it checks are already signed by default if the SDK NuGet package is left unmodified)

But the problematic DLLs seem to be in the "Build" directory of the "DYMO.Connect.SDK" package.
(and those DLLs also are part of the dependency tree of the SDK DLLs. And they also flow into the output directory)
E.g. "DYMO.CrossPlatform.Common.dll".
(DYMO.CrossPlatform.Common, Version=1.4.3.37, Culture=neutral, PublicKeyToken=null)
As far as I can see (with ILspy), the signed "DymoSDK.dll" references it.
(DymoSDK, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8cbe8a3c50c5633e)
Thats what actually is inside the Build directory, but we would need to sign it and fix the reference inside DymoSDK.dll to also point at that signed assembly for my application to not complain because my signed DLL is using unsigned dependencies.

I'm not sure how you could reproduce the actual error with this sample project as I'm actually using the class library as an interop "addin" inside Microsoft Dynamics NAV and talk to the DLL using C/AL code.. Not sure if the same error would appear when trying anything (e.g. call GetPrinters()) from a e.g. WinForms app thats using the DLL.

In my opinion it would be OK to "re-sign" DymoSDK.dll with a new key if necessary to fix the unsigned references.
(but the tool would first have to try to do something with DYMO.CrossPlatform.Common.dll?)

Let me know if you need more information.

Edit
Added code block around the log to make it more readable.

<!-- gh-comment-id:1370641019 --> @HiddenDude commented on GitHub (Jan 4, 2023): I have made a quick VS2022 sample project for it and attached it. (but I had to exclude the actual packages from the zip because of upload size limitations, but they are fresh from the store) [DYMOSDKSampleForSNS.zip](https://github.com/brutaldev/StrongNameSigner/files/10342678/DYMOSDKSampleForSNS.zip) Just a basic .NET Framework class library targeting .NET Framework 4.7.2 with the "DYMO.Connect.SDK" (+ dependencies) and "Brutal.Dev.StrongNameSigner" NuGet packages added, and maybe some short code to initialize the SDK. The output directory looks complete like that and reproduces the error in my application. The log from the build process (including SNS notifications) is this - is this log sufficient or did I miss anything?: ``` ------ Build started: Project: DYMOSDKSampleForSNS, Configuration: Debug Any CPU ------ -- Starting Brutal Developer .NET Assembly Strong-Name Signer Task -- Adding 'C:\Users\user\Desktop\Projects\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\lib\netstandard2.0\DymoSDK.dll' for processing. Adding 'C:\Users\user\Desktop\Projects\DYMOSDKSampleForSNS\packages\SkiaSharp.1.68.0\lib\net45\SkiaSharp.dll' for processing. Checking assembly references in 'C:\Users\user\Desktop\Projects\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\lib\netstandard2.0\DymoSDK.dll'. Checking assembly references in 'C:\Users\user\Desktop\Projects\DYMOSDKSampleForSNS\packages\SkiaSharp.1.68.0\lib\net45\SkiaSharp.dll'. -- Finished Brutal Developer .NET Assembly Strong-Name Signer Task in 00:00:00.7031904 -- DYMOSDKSampleForSNS -> C:\Users\user\Desktop\Projects\DYMOSDKSampleForSNS\DYMOSDKSampleForSNS\bin\Debug\DYMOSDKSampleForSNS.dll ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Elapsed 00:01,503 ========== ``` It looks like the StrongNameSigner is not even doing that much there. (the 2 DLLs that it checks are already signed by default if the SDK NuGet package is left unmodified) But the problematic DLLs seem to be in the "Build" directory of the "DYMO.Connect.SDK" package. (and those DLLs also are part of the dependency tree of the SDK DLLs. And they also flow into the output directory) E.g. "DYMO.CrossPlatform.Common.dll". (DYMO.CrossPlatform.Common, Version=1.4.3.37, Culture=neutral, PublicKeyToken=null) As far as I can see (with ILspy), the signed "DymoSDK.dll" references it. (DymoSDK, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8cbe8a3c50c5633e) Thats what actually is inside the Build directory, but we would need to sign it and fix the reference inside DymoSDK.dll to also point at that signed assembly for my application to not complain because my signed DLL is using unsigned dependencies. I'm not sure how you could reproduce the actual error with this sample project as I'm actually using the class library as an interop "addin" inside Microsoft Dynamics NAV and talk to the DLL using C/AL code.. Not sure if the same error would appear when trying anything (e.g. call GetPrinters()) from a e.g. WinForms app thats using the DLL. In my opinion it would be OK to "re-sign" DymoSDK.dll with a new key if necessary to fix the unsigned references. (but the tool would first have to try to do something with DYMO.CrossPlatform.Common.dll?) Let me know if you need more information. ~Edit~ Added code block around the log to make it more readable.
Author
Owner

@HiddenDude commented on GitHub (Jan 4, 2023):

I've overlooked your additional response in the quote box:

Why not just leave things unsigned, is there is a specific reason you need to actually strong-name sign your project?
Unsigned assemblies can use signed assemblies but not the other way around (which is what this tool was created for). If you do not need to sign your own stuff then don't worry about trying to sign others.

Thats what I'm doing as a workaround for now. Not sign my library = no errors.
Its just usually best practise for NAV DLLs to strong name sign them.
(otherwise there may be issues with deployment later on)
And I never had to not do it because of a 3rd party library. The DYMO SDK may be the first one.

Edit
Added a reason to adhere to the best practises in my case in brackets. But that would require using the signed dependency in my signed wrapper DLL. And it's dependencies also all need to be signed, but the SDK doesn't come like that from the vendor.
Somehow their signed main assembly is referencing some unsigned assemblies and no one ever noticed the error internally..
(if I just sign the unsigned assemblies - if it works - my app would no longer find the signed assembly at run time, so the references need to be correct as well)
Thats how I come across StrongNameSigner after reading a post with ildasm/ilasm commands to manually fix stuff like this.
It might not be a bug, but rather 1-2 new features to catch more of those DLLs (also in the VS build task as I'm not using the tools manually?) and also rewrite signed assemblies to fix references to previously unsigned assemblies after signing them - but you now have an example of a bad SDK to possibly harden the tool on. Its not critical for now. But I really like the idea of one automated tool to fix all DLL strong name signing related problems ;)

<!-- gh-comment-id:1370653260 --> @HiddenDude commented on GitHub (Jan 4, 2023): I've overlooked your additional response in the quote box: > Why not just leave things unsigned, is there is a specific reason you need to actually strong-name sign your project? Unsigned assemblies can use signed assemblies but not the other way around (which is what this tool was created for). If you do not need to sign your own stuff then don't worry about trying to sign others. Thats what I'm doing as a workaround for now. Not sign my library = no errors. Its just usually best practise for NAV DLLs to strong name sign them. (otherwise there may be issues with deployment later on) And I never had to not do it because of a 3rd party library. The DYMO SDK may be the first one. ~Edit~ Added a reason to adhere to the best practises in my case in brackets. But that would require using the signed dependency in my signed wrapper DLL. And it's dependencies also all need to be signed, but the SDK doesn't come like that from the vendor. Somehow their signed main assembly is referencing some unsigned assemblies and no one ever noticed the error internally.. (if I just sign the unsigned assemblies - if it works - my app would no longer find the signed assembly at run time, so the references need to be correct as well) Thats how I come across StrongNameSigner after reading a post with ildasm/ilasm commands to manually fix stuff like this. It might not be a bug, but rather 1-2 new features to catch more of those DLLs (also in the VS build task as I'm not using the tools manually?) and also rewrite signed assemblies to fix references to previously unsigned assemblies after signing them - but you now have an example of a bad SDK to possibly harden the tool on. Its not critical for now. But I really like the idea of one automated tool to fix all DLL strong name signing related problems ;)
Author
Owner

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

Somehow their signed main assembly is referencing some unsigned assemblies

They are probably dynamically loading them and not referencing them.
SNS can fix all of this, but if there is no hard reference then there is no way for it to know it also needs to sign these extra assemblies. You will need to specify the list of assemblies you want to sign and will not be able to easily use the automatic build task.

I'll look into this a bit later, I'm still on vacation.

<!-- gh-comment-id:1371869676 --> @brutaldev commented on GitHub (Jan 5, 2023): > Somehow their signed main assembly is referencing some unsigned assemblies They are probably dynamically loading them and not referencing them. SNS can fix all of this, but if there is no hard reference then there is no way for it to know it also needs to sign these extra assemblies. You will need to specify the list of assemblies you want to sign and will not be able to easily use the automatic build task. I'll look into this a bit later, I'm still on vacation.
Author
Owner

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

I think you'll have a lot more luck with v3.3.0.

In your project file you need to remove the target imports and use your own custom one to just sign DYMO.Connect.SDK.

  1. Install the latest NuGet package (https://www.nuget.org/packages/Brutal.Dev.StrongNameSigner/3.3.0).
  2. Remove the following lines from your .csproj file:
<Error Condition="!Exists('..\packages\Brutal.Dev.StrongNameSigner.X.Y.Z\build\Brutal.Dev.StrongNameSigner.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Brutal.Dev.StrongNameSigner.X.Y.Z\build\Brutal.Dev.StrongNameSigner.targets'))" />
...
<Import Project="..\packages\Brutal.Dev.StrongNameSigner.X.Y.Z\build\Brutal.Dev.StrongNameSigner.targets" Condition="Exists('..\packages\Brutal.Dev.StrongNameSigner.X.Y.Z\build\Brutal.Dev.StrongNameSigner.targets')" />
  1. Add the following into your .csproj file inside the <Project> element:
  <Target Name="BeforeCompile">
    <Exec ContinueOnError="false"
          Command="&quot;..\packages\Brutal.Dev.StrongNameSigner.3.3.0\build\StrongNameSigner.Console.exe&quot; -in &quot;..\packages\DYMO.Connect.SDK.1.4.3.37&quot; -k UnprotectedKey.snk" />
  </Target>
  1. Reload your project and build.

In your test project this builds just fine with no errors/warnings:

  Rebuild started...
1>------ Rebuild All started: Project: DYMOSDKSampleForSNS, Configuration: Debug Any CPU ------
1>  -------------------------------------------------------------------
1>  ---- Brutal Developer .NET Assembly Strong-Name Signer 3.3.0.0 ----
1>  -------------------------------------------------------------------
1>  Console application to sign .NET assemblies with a strong-name key and fix assembly references.
1>  1. Loading assemblies...
1>     Unsupported assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\libdymobarcode.dll': Format of the executable (.exe) or library (.dll) is invalid.
1>     Unsupported assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\usps4cb.dll': Format of the executable (.exe) or library (.dll) is invalid.
1>     Unsupported assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\libdymobarcode.dll': Format of the executable (.exe) or library (.dll) is invalid.
1>     Unsupported assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\usps4cb.dll': Format of the executable (.exe) or library (.dll) is invalid.
1>  2. Checking assembly references...
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.Common.dll'.
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.CrossPlatform.Common.dll'.
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.LabelAPI.dll'.
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\OSX\platspec\DYMO.CrossPlatform.Common.PlatformSpecific.dll'.
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\OSX\platspec\DYMO.LabelAPI.PlatformSpecific.dll'.
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.CrossPlatform.Common.PlatformSpecific.dll'.
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.LabelAPI.PlatformSpecific.dll'.
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\DYMOPrinting.dll'.
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\LW5xxCommunicationLibrary.dll'.
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\PrintingSupportLibrary.dll'.
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\DYMOPrinting.dll'.
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\LW5xxCommunicationLibrary.dll'.
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\PrintingSupportLibrary.dll'.
1>     Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\lib\netstandard2.0\DymoSDK.dll'.
1>  3. Strong-name unsigned assemblies...
1>     Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.CrossPlatform.Common.dll'.
1>     Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.LabelAPI.dll'.
1>     Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\OSX\platspec\DYMO.CrossPlatform.Common.PlatformSpecific.dll'.
1>     Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\OSX\platspec\DYMO.LabelAPI.PlatformSpecific.dll'.
1>     Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.CrossPlatform.Common.PlatformSpecific.dll'.
1>     Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.LabelAPI.PlatformSpecific.dll'.
1>     Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\DYMOPrinting.dll'.
1>     Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\DYMOPrinting.dll'.
1>     Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\lib\netstandard2.0\DymoSDK.dll'.
1>  4. Fix InternalVisibleToAttribute references...
1>     Fixing DYMO.LabelAPI.PlatformSpecific friend reference in assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.LabelAPI.dll'.
1>  5. Fix BAML references...
1>     Replacing BAML entry in assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.LabelAPI.PlatformSpecific.dll'.
1>  6. Save assembly changes...
1>     Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.CrossPlatform.Common.dll'.
1>     Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.LabelAPI.dll'.
1>     Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\OSX\platspec\DYMO.CrossPlatform.Common.PlatformSpecific.dll'.
1>     Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\OSX\platspec\DYMO.LabelAPI.PlatformSpecific.dll'.
1>     Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.CrossPlatform.Common.PlatformSpecific.dll'.
1>     Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.LabelAPI.PlatformSpecific.dll'.
1>     Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\DYMOPrinting.dll'.
1>     Failed to save assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\DYMOPrinting.dll': Writing mixed-mode assemblies is not supported
1>     Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\DYMOPrinting.dll'.
1>     Failed to save assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\DYMOPrinting.dll': Writing mixed-mode assemblies is not supported
1>     Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\lib\netstandard2.0\DymoSDK.dll'.
1>  7. Cleanup...
1>  DYMOSDKSampleForSNS -> C:\DYMOSDKSampleForSNS\DYMOSDKSampleForSNS\bin\Debug\DYMOSDKSampleForSNS.dll
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
========== Elapsed 00:02.623 ==========

You can note the mixed-mode assemblies that are not supported, those are likely the ones being dynamically loaded. You can test this out in your real project and see if it works.

<!-- gh-comment-id:1372749192 --> @brutaldev commented on GitHub (Jan 5, 2023): I think you'll have a lot more luck with [v3.3.0](https://github.com/brutaldev/StrongNameSigner/releases/tag/v3.3.0). In your project file you need to remove the target imports and use your own custom one to just sign `DYMO.Connect.SDK`. 1. Install the latest NuGet package (https://www.nuget.org/packages/Brutal.Dev.StrongNameSigner/3.3.0). 2. Remove the following lines from your `.csproj` file: ``` <Error Condition="!Exists('..\packages\Brutal.Dev.StrongNameSigner.X.Y.Z\build\Brutal.Dev.StrongNameSigner.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Brutal.Dev.StrongNameSigner.X.Y.Z\build\Brutal.Dev.StrongNameSigner.targets'))" /> ... <Import Project="..\packages\Brutal.Dev.StrongNameSigner.X.Y.Z\build\Brutal.Dev.StrongNameSigner.targets" Condition="Exists('..\packages\Brutal.Dev.StrongNameSigner.X.Y.Z\build\Brutal.Dev.StrongNameSigner.targets')" /> ``` 3. Add the following into your `.csproj` file inside the `<Project>` element: ``` <Target Name="BeforeCompile"> <Exec ContinueOnError="false" Command="&quot;..\packages\Brutal.Dev.StrongNameSigner.3.3.0\build\StrongNameSigner.Console.exe&quot; -in &quot;..\packages\DYMO.Connect.SDK.1.4.3.37&quot; -k UnprotectedKey.snk" /> </Target> ``` 4. Reload your project and build. In your test project this builds just fine with no errors/warnings: ``` Rebuild started... 1>------ Rebuild All started: Project: DYMOSDKSampleForSNS, Configuration: Debug Any CPU ------ 1> ------------------------------------------------------------------- 1> ---- Brutal Developer .NET Assembly Strong-Name Signer 3.3.0.0 ---- 1> ------------------------------------------------------------------- 1> Console application to sign .NET assemblies with a strong-name key and fix assembly references. 1> 1. Loading assemblies... 1> Unsupported assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\libdymobarcode.dll': Format of the executable (.exe) or library (.dll) is invalid. 1> Unsupported assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\usps4cb.dll': Format of the executable (.exe) or library (.dll) is invalid. 1> Unsupported assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\libdymobarcode.dll': Format of the executable (.exe) or library (.dll) is invalid. 1> Unsupported assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\usps4cb.dll': Format of the executable (.exe) or library (.dll) is invalid. 1> 2. Checking assembly references... 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.Common.dll'. 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.CrossPlatform.Common.dll'. 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.LabelAPI.dll'. 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\OSX\platspec\DYMO.CrossPlatform.Common.PlatformSpecific.dll'. 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\OSX\platspec\DYMO.LabelAPI.PlatformSpecific.dll'. 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.CrossPlatform.Common.PlatformSpecific.dll'. 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.LabelAPI.PlatformSpecific.dll'. 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\DYMOPrinting.dll'. 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\LW5xxCommunicationLibrary.dll'. 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\PrintingSupportLibrary.dll'. 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\DYMOPrinting.dll'. 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\LW5xxCommunicationLibrary.dll'. 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\PrintingSupportLibrary.dll'. 1> Checking assembly references in 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\lib\netstandard2.0\DymoSDK.dll'. 1> 3. Strong-name unsigned assemblies... 1> Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.CrossPlatform.Common.dll'. 1> Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.LabelAPI.dll'. 1> Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\OSX\platspec\DYMO.CrossPlatform.Common.PlatformSpecific.dll'. 1> Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\OSX\platspec\DYMO.LabelAPI.PlatformSpecific.dll'. 1> Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.CrossPlatform.Common.PlatformSpecific.dll'. 1> Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.LabelAPI.PlatformSpecific.dll'. 1> Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\DYMOPrinting.dll'. 1> Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\DYMOPrinting.dll'. 1> Signing assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\lib\netstandard2.0\DymoSDK.dll'. 1> 4. Fix InternalVisibleToAttribute references... 1> Fixing DYMO.LabelAPI.PlatformSpecific friend reference in assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.LabelAPI.dll'. 1> 5. Fix BAML references... 1> Replacing BAML entry in assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.LabelAPI.PlatformSpecific.dll'. 1> 6. Save assembly changes... 1> Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.CrossPlatform.Common.dll'. 1> Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\DYMO.LabelAPI.dll'. 1> Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\OSX\platspec\DYMO.CrossPlatform.Common.PlatformSpecific.dll'. 1> Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\OSX\platspec\DYMO.LabelAPI.PlatformSpecific.dll'. 1> Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.CrossPlatform.Common.PlatformSpecific.dll'. 1> Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\Win\DYMO.LabelAPI.PlatformSpecific.dll'. 1> Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\DYMOPrinting.dll'. 1> Failed to save assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x64\DYMOPrinting.dll': Writing mixed-mode assemblies is not supported 1> Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\DYMOPrinting.dll'. 1> Failed to save assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\Build\DYMOLib\x86\DYMOPrinting.dll': Writing mixed-mode assemblies is not supported 1> Saving changes to assembly 'C:\DYMOSDKSampleForSNS\packages\DYMO.Connect.SDK.1.4.3.37\lib\netstandard2.0\DymoSDK.dll'. 1> 7. Cleanup... 1> DYMOSDKSampleForSNS -> C:\DYMOSDKSampleForSNS\DYMOSDKSampleForSNS\bin\Debug\DYMOSDKSampleForSNS.dll ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ========== ========== Elapsed 00:02.623 ========== ``` You can note the mixed-mode assemblies that are not supported, those are likely the ones being dynamically loaded. You can test this out in your real project and see if it works.
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#68
No description provided.