title: XSLT Reading from File
body: <p>I have a code that reads my Xslt templates from Resources but I have to make it reads from seperated files in root directory of application. So this is my code:</p>
  <pre><code>            docs[0] = new DocumentReferenceType
              {
                  ID = new IDType { Value = new Guid().ToString() },
                  IssueDate = new IssueDateType { Value = DateTime.Now },
                  DocumentType = new DocumentTypeType { Value = &quot;xslt&quot; },
                  Attachment = new AttachmentType
                  {
                      EmbeddedDocumentBinaryObject = new EmbeddedDocumentBinaryObjectType
                      {
                          filename = &quot;customxslt.xslt&quot;,
                          encodingCode = &quot;Base64&quot;,
                          mimeCode = &quot;applicationxml&quot;,
                          format = &quot;&quot;,
                          characterSetCode = &quot;UTF-8&quot;,
                          Value = Encoding.UTF8.GetBytes(Properties.Resource1.XSLTFile)
  
                      }
                  }
              };
              return docs;
  </code></pre>
  <p>What should I write to &quot;Properties.Resource1.XSLTFile&quot; read from XSLTFile.xslt in root directory? I tried to write this:</p>
  <pre><code>        string _filePath = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory);
              _filePath += @&quot;\XSLTFile.xslt&quot;;
  </code></pre>
  <p>And I changed &quot;Properties.Resource1.XSLTFile&quot; with &quot;_filePath &quot; there but it gave me this error: &quot;HTML conversion failed: XSLT compilation error&quot;</p>