How to determine path to project folder in .Net?

Posted by paul on Stack Overflow See other posts from Stack Overflow or by paul
Published on 2010-03-19T14:07:49Z Indexed on 2010/03/19 14:11 UTC
Read the original article Hit count: 235

Filed under:
|
|

I have a project folder called XSL which contains xsl files used for transforming xml. I use the following code to fetch an xsl file:

string html = @"c:\temp\export.html";
XslCompiledTransform transform = new XslCompiledTransform();
Uri uri = new Uri(@"XSL\ToHtml.xsl", UriKind.Relative);
transform.Transform(CurrentXmlFile, html);
System.Diagnostics.Process.Start(html);

This works ok when debugging but when I deploy using clickonce and install it, I get an error - 'Could not find part of the path {my user path}\XSL\ToHtml.xsl'

What must I do to correctly reference this path?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about path