Skip to content
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

.Net Framework library including .Net Standard pulls in wrong Flee assembly #69

Open
FrederickBrier opened this issue Jul 5, 2019 · 2 comments

Comments

@FrederickBrier
Copy link

I have a .Net Standard library that uses Flee. It apparently pulls in assembly Flee.NetStandard20. Another of my libraries, which is Net472, depends on the first library. Compiling generates the following error:

Error	CS0012	The type 'ExpressionContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'Flee.NetStandard20, Version=1.0.0.0, Culture=neutral, PublicKeyToken=85238e57c1c34b81'.	Net472Library	D:\Projects\MyProject\Net472Library	\ClassWithExpressionContextParameter.cs	22	Active

The Net472Library is linking with Flee.Net45 instead of Flee.NetStandard. The Net472Library.csproj includes the following line in the first <PropertyGroup> element:

    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

I am not sure how to force the Net472Library to use the Flee.NetStandard20, as you only specify
"Flee" in the <PackageReference> element.

@FrederickBrier
Copy link
Author

FrederickBrier commented Jul 5, 2019

This is actually not a problem with Flee. Apparently is part of a larger issue with the .Net SDK. Unfortunately, it is an open issue. My workaround was to clone the Flee project and deleting the net45 project, updating the nuspec file to be "Flee.NetStandard", creating a new NuGet package, checking it into our local repo, and updating the .csproj files to specify the new package name.

One question is if you have a .Net Standard version of the library, why do you need the net45 version? Backward compatibility?

@NetDefender
Copy link

Hi, i had the similar problem an i did the following, I changed the csproj to force choosing the netstandard20 version and it worked:

<Reference Include="Flee.NetStandard20, Version=1.0.0.0, Culture=neutral, PublicKeyToken=85238e57c1c34b81, processorArchitecture=MSIL"> <HintPath>..\..\packages\Flee.1.2.2\lib\netstandard20\Flee.NetStandard20.dll</HintPath> </Reference>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants