Roald87 / TcBlack

Opnionated code formatter for TwinCAT.
MIT License
103 stars 11 forks source link

TcBlackCore can not be build #57

Closed SankariNL closed 3 years ago

SankariNL commented 3 years ago

When trying to build the TcBlackCore project I get the following error:

Unable to get MD5 checksum for the key file "TcBlackCoreSign.pfx". Could not find file 'C:\Users_username\source\repos_username\TcBlack\src\TcBlackCore\TcBlackCoreSign.pfx'.

This file is mentioned in the solution explorer, but is not included in the repo.

After removing the file in the solution explorer the solution could be build.

PTKu commented 3 years ago

@SankariNL you will need to create your own pfx file. Open TcBlackCore project properties navigate to signing. Roll out the combo and select new... image

NOTE You will need to set a password otherwise you will get snk and not pfx file

image

Roald87 commented 3 years ago

Thanks for answering @PTKu! I didn't even realise the signature was added and didn't know if it was really necessary. After some Googling I found that for some applications it makes sense for others not. But I'm still unsure whether it makes sense for TcBlack. What's your take @PTKu ?

PTKu commented 3 years ago

That's a good question. You're right there are many opinions out there whether sign or not to sign :). I do not have definite answer for that. We do sign all assemblies that are going public and most of those we use internally. I am not sure about this, but you may need to sign your assemblies when you use them in VS extension, I vaguely recall that was the requirement. Rule of thumb: if you are not sure just sign. From time to time you will get intro troubles with signed assemblies (testing internal members require some additional work beside InternalVisibleTo(assemblyName) attribute, in some situation you may have a third party assembly that has no signed version available and you need to workaround that...). Anyways it adds some layer of security to your application, I guess it's worth the pain:)

Roald87 commented 3 years ago

@PTKu Thanks for the clarification! Then I'll keep it.

SankariNL commented 3 years ago

Hello guys, thanks for the feedback!

I've added some extra documentation about this, see: https://github.com/Roald87/TcBlack/pull/65#issue-623130396

Also for some reason I trying to contribute using Visual Studio 2019. This works fine for the most part, there is just 1 reference that is not available in Visual Studio 2019, and also not on nuget.org. I can contribute by manually changing the reference, but not commiting it. I've also included this in the documentation.