-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In NuGet package, .NET Framework and .NET Standard versions of JIL should use the same assembly identity #279
Comments
We have the same problem ... Is there any solution? |
Can this issue be more prioritized? We are facing it too.. |
Ditto |
We hit this in the Stack Overflow port to .NET Core as well. I took today and did all the work here - PR incoming shortly. |
This does a lot of things. The root cause is issue kevin-montrose#279, because Jil.dll and Jil.Core.dll differ anything restoring from a netstandard library that depends on Jil being restored to a net4x project go boom. Because the netstandard lib referenced Jil.Core, with a different signature. It cannot be fixed on the user end. But hey, multi-targeting works now...so I upgraded Jil to use it. This commit: - Drops JilCore and JilCore.Tests (folded into Jil and JilTests) - Drops \packages (uses <PackageReference>) - Adds a netstandard2.0 build (far fewer references and less baggage for most users) - Moves testing to xunit (makes dotnet xunit available) - Tests all 3 releases - Adds a build.cmd (runs tests, creates packages in /.nupkgs/) - Does *not* modify versioning, still manual. To build, just run build.cmd.
I've opened PR #304 to fix this mismatch up in the next release. |
This fixes restore and signature issues on net4x platforms, see kevin-montrose/Jil#279 for details and kevin-montrose/Jil#304 for the fix.
Jil 2.16.0 has been released and I've confirmed this all behaves as expected now. For anyone that hit this: an upgrade to 2.16.0 should fix you up. There's also now a |
I can confirm that 2.16.0 fixes the issue. Thanks a lot @NickCraver ! |
Closing this out to tidy up - it's all fixed up now :) |
This fix causes a conflict when an application uses 2 NuGets that use this library when:
Basically, the pre-change dependency is looking for a I have not found a way around it at this time. (Aside from contacting the package maintainers and asking them to upgrade. But that is a timeline killer.) |
@Vaccano The bad news is: tt was an issue either way. If another package was Which package are you hitting against on an old version? It's possible I could poke something there. |
@NickCraver I appreciate the offer for help! However it is an internal team that built the package that is using the 2.15.4 version. I am already leaning on them to update the dependency. |
Currently, the layout of the Jil NuGet package is similar to this:
IE, the assembly name is different depending on whether you are using the .NET Framework version or the .NET Standard version. This presents a problem when a .NET Framework project references a .NET Standard project which uses Jil. The .NET Standard project will be compiled against Jil.Core.dll, but in the .NET Framework project it will be Jil.dll that is deployed, and at runtime Jil.Core.dll won't be available.
When creating a NuGet package with different versions of a library for different targets, the library should use the same assembly name for each platform, and platforms with "broader" reach (ie .NET Standard) should be "API Compatible" with the more specific versions (ie .NET 4.5).
In order to make this work without breaking code which was compiled against previous versions of the package and Jil.Core.dll, I would suggest creating a version of Jil.Core.dll which has type forwards to Jil.dll for all the types that were previously in Jil.Core.dll. Then deploy that type-forward version of Jil.Core in both the
lib/net45
andlib/netstandard1.6
folders of the package.The text was updated successfully, but these errors were encountered: