I'm trying to write an Xml program on Visual Studio 2017 and have error on:
using System.Xml;
...
XmlWriter.Create("C:\\myxmlfile.xml", settings);
With this message: The type name 'Create' doesn't exist in the type XmlWriter.
I suspect that incomplete installation (which unfortunately didn't fixed yet) of my Visual Studio caused this problem. How can I fix it?
My guess is that your code actually looks something like this:
var writer = new XmlWriter.Create("C:\\myxmlfile.xml", settings);
if it is then remove the new
and it will work.
The reason is that in the XmlWriter class Create is static so can not be newed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With