Reputation: 135
I have this line of code:
XDocument doc = XDocument.Parse(File.ReadAllText(Properties.Resources.settings));
AndI get this error message:
System.ArgumentException: 'Illegal characters in path.'
I have added the file "settings.xml" as a resource to my project in Visual Studio 2017 Community.
The path to my project is:
C:\Users\myname\OneDrive\Projects\Test\Test\Resources
Upvotes: 2
Views: 85
Reputation: 77304
If settings
is the file you already added, you will get the contents. That's the point of the resource system, that you don't need to read from files:
var doc = XDocument.Parse(Properties.Resources.settings);
Upvotes: 1