简体   繁体   中英

How do I use ServiceStack from a strongly named host?

I have a code base which requires strong names.

At first, I thought this was going to be an easy fix, as I simply assigned strong names to the ServiceStack assemblies I needed. This failed due to inter-dependencies within ServiceStack on weak named assemblies. Then, I bit the bullet and recompiled ServiceStack using my key file - which was undesirable as I didn't see a means by which this could be done in a single location and had to add it to each project.

Even then, the solution failed to build with the tests due to this:

[assembly: InternalsVisibleTo("ServiceStack.Common.Tests")]

I'm finding myself in a downward spiral of having to tweak things to get them to work and taking myself further and further away from source libraries I'd like to keep updated.

How should I approach this problem? I don't like where this is going...

It may not solve your problem, as this is not 100% reliable (although, if it works fine on one host it will work on all hosts - so if you have good test coverage you can at least make sure it worked fine).

LibZ (disclaimer: LibZ.Author = Me) has a function sign-and-fix which finds unsigned assemblies, traverses assembly tree bottom-up and replaces all assembly references to this "new" signed assemblies.

Link: https://libz.codeplex.com/wikipage?title=Signing%20assemblies&referringTitle=Documentation

Could you just the signed version that is available in nuget? ServiceStack.Signed

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM