MethodAccessException - Strong-name signed assemblies must specify a public key in InternalsVisibleTo

232 views
Skip to first unread message

Joshua Go

unread,
May 19, 2016, 11:53:27 AM5/19/16
to MSBuild Community Tasks
Hi,

I'm trying to add a task to modify the Assembly version information from Git commits. This is old, but I followed the steps in this article: http://nowfromhome.com/msbuild-add-git-commit-hash-to-assemblyinfo/

When I build the project, I get a MethodAccessException. Here are the first few error lines:
  1. error MSB4018: The "GitVersion" task failed unexpectedly.
  2. error MSB4018: System.MethodAccessException:  Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.
  3. error MSB4018:    at MSBuild.Community.Tasks.Git.GitClient.ValidateParameters()\r
Note: I removed the path information since it adds clutter.
Note: I'm using the latest MSBuildTasks from Nuget (v1.5.0.183).

I tried looking, but couldn't find much information. Do I need to add an InternalsVisibleTo? I tried the following:

[assemblyInternalsVisibleTo("MSBuild.Community.Tasks")]
[assemblyInternalsVisibleTo("GitVersion")]


Any help would be greatly appreciated.

Thanks,
Josh

Joshua Go

unread,
May 29, 2016, 10:44:36 PM5/29/16
to MSBuild Community Tasks
As suspected, it was an issue with signing.


And the latest nuget package, 1.5.0.196, works as expected.
Reply all
Reply to author
Forward
0 new messages