I've got a library that was written in full .Net which I've got to move to .Net Standard 2.1 - I've validated my process on smaller projects and from a coding and .csproj perspective it's all fine.
The problem: This library wraps around a 3rd party SQL database using EF6 so I have to stick to the Database-First model and with that I need to supply metadata to in my connection string to show the .csdl, .msl and .ssdl resources.
The project is multi-targeting .Net 4.7.2 and .Net Standard 2.1 and comparing the output in dotPeek I can clearly see those resources are missing from the new output:
What I tried:
Double checked that the "Metadata Artifact Processing" is set to "Embed in Output Assembly".
Validated that the .Net 4.7.2 output works as intended.
I've tried specifying resources in the connection string like:
metadata=res://*/;provider=...
But that only throws a different error:
Argument 'xmlReader' is not valid. A minimum of one .ssdl artifact must be supplied
Any ideas will be most appreciated, many thanks.
In a bizarre fashion I have resolved this by swapping the target framework around...
From:
<TargetFrameworks>net472;netstandard2.1</TargetFrameworks>
To:
<TargetFrameworks>netstandard2.1;net472</TargetFrameworks>
And it just started including the resources correctly... strange but it works!