ASP.NET Pre-Compile and Merge with Strong Name Signing Certificate

Matt 1 Reputation point
2021-06-02T05:49:27.993+00:00

Hi all,

I have an ASP.NET application that is currently being strong name signed, this seems to work well and the application will not accept DLLs that have conflicting public key tokens according to the assembly manifest at build time, however where I've come unstuck is when using the pre-compile and merge options during a publish.
The pre-compile merge option I am currently using is "merge all outputs to a single assembly" and the resulting DLL from aspnet_merge.exe is not strong named and the application does not seem to care, running as per normal.

After some research I found that aspnet_merge.exe has a parameter to provide a -keyfile, although this is not available in Visual Studio's publishing GUI (at least not that I can see), so I wrote a script that appended the key information to the command. Upon inspecting the merged output DLL after the change I can see that it is in-fact now being strong named, but the problem is the web application is not verifying the public token as it would for the other strong named DLLs, which I assume is because it is not apart of the assembly manifest at build time?

Is there any way to achieve a strong named DLL from aspnet_merge.exe, that is also public token verified like the other DLLs?

Appreciate any suggestions or advice.

Thanks.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,481 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.