Open nesherhh opened 6 years ago
Hi, thanks for the suggestion.
Unfortunately, there is no easy way to support this feature. I made a little research and found some information about what is needed to support this.
Due to this post from stackoverflow, I need to call Strong Name Tool. I did this with a test project:
There are multiple problems with this approach:
sn
is not recognized as a command, so I have to use the full path to the sn.exe. The strong name tool is located in different locations unter C:\Program Files (x86)\Microsoft SDKs\Windows\
. My system is a standard Win7 Professional installation with only VS2015 and VS2017 installed. So I can't assume to that sn is a recognized command on other systems. I don't know if I installed Windows SDKs by myself or if they got installed via Windows Update or Visual Studio. So I currently can't assume that the program is installed on every system where the analyser runs.
Due to this blog post, I can retrieve these path by locking in the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\
My registry:
But my Microsoft SDKs folder shows more installed SDKs, so looking at the registry is no foolproof way the get the path to the strong name tool.
The only solution I see is, to make the path to sn.exe configurable within the extension. If the path is not configured, you can't use this extensions for signed assemblies. But I don't like tools that have to be configured before I can use them. Furthermore I can't see a reliable way to retrieve the public key, if the *.dll not exist yet.
Maybe you have some ideas how to solve the problem.
Best Greetings
Badf00d
Please add support for strong named projects.