XSD file path
-
Perhaps this is a rather basic question, but is there a way to get the path to an XSD file (considering it's added to my current project) without having to hard-code the path?
Application.StartupPath
+Path.DirectorySeparatorChar
+ relative path to your file (in simplest case the filename)
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
Application.StartupPath
+Path.DirectorySeparatorChar
+ relative path to your file (in simplest case the filename)
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
Great, thank you! I put the XSD file two directories up, so the following two lines now do the trick: DirectoryInfo schemaDir = (Directory.GetParent(Application.StartupPath)).Parent).Parent; string schemaFullName = schemaDir + Path.DirectorySeparatorChar + "OptionsSchema.xsd";