[GH-ISSUE #14] Update InternalsVisibleTo to prevent exceptions at runtime #12

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

Originally created by @GeertvanHorrik on GitHub (May 19, 2015).
Original GitHub issue: https://github.com/brutaldev/StrongNameSigner/issues/14

Originally assigned to: @brutaldev on GitHub.

Some resigned assemblies use InternalsVisibleTo. This causes runtime exceptions as you can read here:

https://catelproject.atlassian.net/browse/CTL-653?focusedCommentId=19053&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-19053

Details:

An exception of type 'System.MethodAccessException' occurred in Catel.MVVM.dll but was not handled in user code
Additional information: D:\DevSamples\StrongNameProblem\MyTestApp\bin\Debug\Catel.Core.dll Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.
Originally created by @GeertvanHorrik on GitHub (May 19, 2015). Original GitHub issue: https://github.com/brutaldev/StrongNameSigner/issues/14 Originally assigned to: @brutaldev on GitHub. Some resigned assemblies use InternalsVisibleTo. This causes runtime exceptions as you can read here: https://catelproject.atlassian.net/browse/CTL-653?focusedCommentId=19053&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-19053 Details: ``` An exception of type 'System.MethodAccessException' occurred in Catel.MVVM.dll but was not handled in user code Additional information: D:\DevSamples\StrongNameProblem\MyTestApp\bin\Debug\Catel.Core.dll Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations. ```
kerem 2026-02-25 21:30:27 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@brutaldev commented on GitHub (May 19, 2015):

InternalsVisibleTo attributes are re-written with the new signed assembly public keys as of version 1.4.2. Invalid InternalsVisibleTo attributes are also removed as of version 1.4.4 which is the problem described in the exception above. The current version is 1.4.5.

To ensure this error does not occur, update StrongNameSigner to at least version 1.4.4 which will remove any InternalsVisibleTo attributes that were not updated with reference public keys after signing.

<!-- gh-comment-id:103609951 --> @brutaldev commented on GitHub (May 19, 2015): `InternalsVisibleTo` attributes are re-written with the new signed assembly public keys as of version [1.4.2](https://github.com/brutaldev/StrongNameSigner/releases/tag/1.4.2). Invalid `InternalsVisibleTo` attributes are also removed as of version [1.4.4](https://github.com/brutaldev/StrongNameSigner/releases/tag/1.4.4) which is the problem described in the exception above. The current version is [1.4.5](https://github.com/brutaldev/StrongNameSigner/releases/tag/1.4.5). To ensure this error does not occur, update StrongNameSigner to at least version [1.4.4](https://github.com/brutaldev/StrongNameSigner/releases/tag/1.4.4) which will remove any `InternalsVisibleTo` attributes that were not updated with reference public keys after signing.
Author
Owner

@brutaldev commented on GitHub (May 19, 2015):

Please note that the invalid references will only be removed from assemblies that are signed by StrongNameSigner.

In the attached zip file from the link you sent, Catel.Core.dll and Catel.MVVM.dll are already signed (with invalid InternalsVisibleTo still in place). If you try to process these through the tool again, nothing will happen because they already have strong-name signatures and will not be modified.

Please re-sign the original files with version 1.4.4 or higher to have the InternalsVisibleTo attributes correctly removed.

<!-- gh-comment-id:103612804 --> @brutaldev commented on GitHub (May 19, 2015): Please note that the invalid references will only be removed from assemblies that are signed by StrongNameSigner. In the attached zip file from the link you sent, Catel.Core.dll and Catel.MVVM.dll are already signed (with invalid `InternalsVisibleTo` still in place). If you try to process these through the tool again, nothing will happen because they already have strong-name signatures and will not be modified. Please re-sign the original files with version 1.4.4 or higher to have the `InternalsVisibleTo` attributes correctly removed.
Author
Owner

@GeertvanHorrik commented on GitHub (May 20, 2015):

Thanks for all the info, will let them know.

<!-- gh-comment-id:103791153 --> @GeertvanHorrik commented on GitHub (May 20, 2015): Thanks for all the info, will let them know.
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#12
No description provided.