Web-Anchor icon indicating copy to clipboard operation
Web-Anchor copied to clipboard

Targeting netstandard2.0/netstandard2.1

Open carl-berg opened this issue 5 years ago • 7 comments
trafficstars

Current behavior when installing WebAnchor on a .net core 3.1 project is that it wants a lot of dependencies image Since Webanchor supports netstandard2.0 (maybe could support netstandard2.1 aswell now?) i assume the culprit here is WebAnchor.Analyzers which targets only netstandard1.3

carl-berg avatar Apr 08 '20 13:04 carl-berg

...could also be Castle.Core which only goes up to .NETStandard 1.5 which could be a harder nut to crack https://github.com/castleproject/Core/issues/407... but it does seem like they're working on it https://github.com/castleproject/Core/pull/485

carl-berg avatar Apr 08 '20 14:04 carl-berg

I don't understand this. I've heard I should always target the lowest possible netstandard.

mattiasnordqvist avatar Apr 11 '20 08:04 mattiasnordqvist

However, targeting lower .NET Standard versions introduces a number of support dependencies. If your project targets .NET Standard 1.x, we recommend that you also target .NET Standard 2.0. This simplifies the dependency graph for users of your library that run on .NET Standard 2.0 compatible frameworks, and it reduces the number of packages they need to download.

https://docs.microsoft.com/en-us/dotnet/standard/net-standard

carl-berg avatar Apr 12 '20 11:04 carl-berg

Ok so target low and multitarget

mattiasnordqvist avatar Apr 12 '20 18:04 mattiasnordqvist

Yeah, that's what i think is the recommended way

carl-berg avatar Apr 15 '20 06:04 carl-berg

So I released 6.6.2 which also targets netstandard2.1. For some reason, I could not make the analyzer multitarget, and the vsix, which is netframework (has to be?) could not reference a package targeting netstandard2.1, so.... webanchor 6.6.2 still references the same analyzer. Hoping a bit that because it's a dev dependency it's going to work out fine anyways. We'll see

mattiasnordqvist avatar Apr 15 '20 16:04 mattiasnordqvist

my dependency list still looked crazy I think. same for you @carl-berg ? Maybe the analyzer should be it's own package entirely, and not be referenced by webanchor at all.

mattiasnordqvist avatar Apr 15 '20 16:04 mattiasnordqvist