Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Multi target net frameworks conflicts

$
0
0

I have a Nuget package project that targets framework netcoreapp2.2. I'm trying to use it for an application that contains other projects targeting frameworks netstandard2.0;netcoreapp3.1.

This is what I currently have in the .csproj for that

<PropertyGroup><TargetFrameworks>netcoreapp2.2;netstandard2.0;netcoreapp3.1</TargetFrameworks></PropertyGroup><ItemGroup Condition="'$(TargetFramework) '=='netcoreapp2.2'">( ........ )

In the classes I get the conflicts I'm using the conditional directive

##if true

1. But I'm getting compile errors because some of the extensions I'm using here are not available in one of the frameworks above.

  1. *[Solved] I get this error:

    Error CS0006 Metadata file 'C:\Users\user\source\repos\workspace\project\bin\Debug\netstandard2.0\project.dll' could not be found project.Test (netcoreapp2.2)

Is there any way I can target multiple frameworks to be able to download the NuGet package in the other projects?

Any ideas for a better approach?

Thanks

Update:Error #2 The file project.dll didn't exist. It wasn't autogenerated by rebuilding the project. Adding the file manually solved it.


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>