ardalis / Specification

Base class with tests for adding specifications to a DDD model
MIT License
1.93k stars 246 forks source link

Add Strong-Name version #262

Open songjiefa opened 2 years ago

songjiefa commented 2 years ago

I try to reference this package in my wpf(.net 4.8 & .net 6) project which has strong-name , but unfortunately, it throw exception says this assembly need strong-name.

LangSensei commented 2 years ago

+1 here.

We are trying to reference this project in our MSFT internal application, but it also requires strong name.

ardalis commented 2 years ago

Ok I'll try add add strong naming to an upcoming version. I haven't done much with this in the past so I need to figure it out.

LangSensei commented 2 years ago

@ardalis

Hi, thanks for the quick feedback.

I was running the internal package publishing tool and hit the following error message:

WARNING: File not StrongName signed: lib\netstandard2.0\Ardalis.Specification.dll ERROR: File not AuthentiCode signed: lib\netstandard2.0\Ardalis.Specification.dll

So, I think the dll needs to be both "StrongName" and "AuthentiCode" signed.

LangSensei commented 2 years ago

Hi @ardalis

It seems like publishing package with target framework version above netcore, strong name is not required.

Could you please add multi-target to Ardalis.Specification with netstandard2.0 and net6.0?

https://docs.microsoft.com/en-us/dotnet/standard/assembly/strong-named

Quote: For .NET Core and .NET 5+, strong-named assemblies do not provide material benefits. The runtime never validates the strong-name signature, nor does it use the strong-name for assembly binding.

Since adding multi-target shouldn't be that complicated, can we get an ETA on this?

ardalis commented 2 years ago

I've done some research into this and looked at what other popular NuGet packages have done, and it looks like having you use StrongNamer (or similar tools) would be better than adding strong names to this package.

https://github.com/jbogard/MediatR/issues/86

LangSensei commented 2 years ago

image image image

@ardalis

I think you have looked into a very old thread. According to our internal tool, both MediatR and MediatR.Contracts are strong name signed.

But would you try my another suggestion first? Make Ardalis.Specification multi-targets to both netstandard2.0 and net6.0.

It seems like net6.0 doesn't require the strong name check.

ardalis commented 2 years ago

Yes we can certainly do that.

fiseni commented 1 year ago

What's the last status here? Do folks still need this? Should we investigate this issue further? Btw, @LangSensei we have updated the TFMs in the recent versions, now it multi-targets netstandard2.0 and net6.0, so at least you won't have issues with newer projects.