-
Notifications
You must be signed in to change notification settings - Fork 289
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
EmbeddedResource seems to be ignored for the XML Type Provider #1310
Comments
@rabejens I am also using XML Type Provider but do not have any errors (however there were some a couple of months ago). I've also tried packing my library with TP-provided types into NuGet-package and it also has worked for me. Based on your message it seems that your actions should be correct. The only differences between your case and mine:
type XmlData = XmlProvider<Schema = "Data/MySchema.xsd", EmbeddedResource = "MyLib, MyLib.Data.MySchema.xsd"> |
@ArtemyB's fix worked for me, note that the EmbeddedResource string appears to be case-sensitive with regards to the file names |
Hi there, I am facing the same issue... I have tried to apply the previous comments but nothing is working. It seems to always rely on the local file, so when I get rid of it, I get an exception. Anyone with some idea? |
@Evangelink hi, can't suggest anything else for now -- I'm still using the library which I created then and all is done according to the description in my comment above. But FSharp.Data dependency hasn't been updating since then and is v3.3.3 -- maybe something has changed in the newer version 🤔 However I've noticed one more detail not mentioned there previously -- the .xml/.xsd file should be added as an embedded resource to the project, so its' "Build action" property should be in "EmbeddedResource" state or, in other words, in project-file its entry should look like |
I had the same issue, re-checked the embedded resource path and everything was OK. After some debugging, I realized I had defined the provided type inside a namespace, not a module, which I realized could mess with the type's assembly and therefore embedded resources. After putting the type into a module, everything works. EDIT: nevermind, it still doesn't work, probably tested it wrong |
For me, the problem seems to arise when |
I am using the XML Type Provider with FSharp.Data. I have a line like this:
I set the
Sample.xml
to "Embedded Resource, Do Not Copy".I packed the
MyLib
to a NuGet package and used it in another program. But when I now execute it, I get aDirectoryNotFoundException
saying it can't findC:\Path\To\My\SolutionWithMyLib\MyLib\Sample.xml
So, it seems to ignore the
EmbeddedResource
directive. Is that not supported with the XML Provider?Followup
I found #1191 and changed the
EmbeddedResource
toMyLib, MyLib.Sample.xml
but that did not change anything.The text was updated successfully, but these errors were encountered: