Capgemini / Cauldron

C# Toolkit
MIT License
76 stars 18 forks source link

Strong Name Support #64

Closed L45eMy closed 6 years ago

L45eMy commented 6 years ago

I'm trying to use the BasicInterceptors in a project with strong name signing. When trying to access an method of this project, I always get following error:

System.IO.FileLoadException: "Could not load file or assembly "Cauldron.Interception, Version=3.0.0.29, Culture=neutral, PublicKeyToken=null" or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)"

Is interception supported in strong name objects?

reflection-emit commented 6 years ago

This is actually a common problem in all Fody add-ins... Have you tried delay signing?

I have to test it myself later on, since I haven’t had projects with strong names for a long time now, therefor never bothered testing it against Cauldron.


Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder • Geschäftsführer: Dr. Michael Schulte (Sprecher) • Jost Förster • Dr. Peter Lempp • Dr. Volkmar Varnhagen

Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

L45eMy commented 6 years ago

Yes, delay signing gives the same error. Other Fody add-ins are working, e.g. PropertyChanged has a strongly-named assembly.

reflection-emit commented 6 years ago

I think Properchanged.Fody removes itself from the dependencies after weaving.

The Cauldron might be just the assembly where the interfaces resides... That assembly is not signed... Let me figure something out.


Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder • Geschäftsführer: Dr. Michael Schulte (Sprecher) • Jost Förster • Dr. Peter Lempp • Dr. Volkmar Varnhagen

Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

reflection-emit commented 6 years ago

I will try to find a proper solution for this since I think it is not possible to include both signed and not signed assembly in a nuget package. In the mean time you can try this .NET Assembly Strong-Name Signer

reflection-emit commented 6 years ago

I tested the current Cauldron nuget version with StrongNamer and it works perfectly. Please add this StrongNamer to your project.

L45eMy commented 6 years ago

Thank you, it works with StrongNamer. I still don't get the distaste for strongly-named assemblies (PropertyChanged.Fody is signed even though it's removed after weaving), but this seems to be some kind of philosophical question.

reflection-emit commented 6 years ago

Well... I would sign them eventually... But I can’t just do that in such a short time. I have to test the signed assemblies against mixed projects for example. I don’t want to break peoples work or at least I am trying to minimize the breaks.


Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder • Geschäftsführer: Dr. Michael Schulte (Sprecher) • Jost Förster • Dr. Peter Lempp • Dr. Volkmar Varnhagen

Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.