Best way to deploy and link to an XSLT file

In a visual studio project, I have three levels: a data layer, a business layer, and a presentation layer.

In the data layer, I have several XSLTs that convert some objects to email, everything works fine, but I found that XSLTs are not created and are not copied when created.

Currently, I created a folder at the deployment location and placed XSLT there, but I'm interested in using the manual process to update them.

Has anyone encountered a similar problem, and if so, how did they get around this.

Uses an MSBuild script to copy build artifacts to the right place, does anyone have examples of this?

Thaks

+3
source share
4 answers

Visual Studio 2005/2008, - XSLT .

  • .
  • "". , , : " . , ". .
  • " " " ".
  • XSLT .

:

// To get the contents of the resource as a string:
string xslt = global::MyNamespace.Properties.Resources.MyXsltFile;
// To get a Stream containing the resource:
Stream xsltStream = global::MyNamespace.Properties.Resources.ResourceManager.GetStream("MyXsltFile");


Visual Studio 2003, XSLT DLL. Visual Studio , "" " ". GetManifestResourceStream, , XSLT (). , , , .

, , My.DataLayer. Templates, Transform.xslt. XSLT :

// There are numerous ways to get a reference to the Assembly ... this way works
// when called from a class that is in your data layer.  Have a look also at the
// static methods available on the Assembly class.
System.Reflection.Assembly assembly = (GetType()).Assembly;
System.IO.Stream xsltStream = assembly.GetManifestResourceStream("My.DataLayer.Templates.Transform.xslt");

CodeProject.

+4

, , , , XSLT, ? - ?

0

VS XSLT , .

0

, .

- , .

DataLayer XSLT Bin DataLayer. , , DLL, XSLT

0

Source: https://habr.com/ru/post/1699041/


All Articles