Smart client deploy question
Smart client deploy question
am 21.01.2008 21:28:03 von AutoTrackerPlus
I have a .Net 2005 windows application. In a method, I do the following to
load an XML file..
System.Xml.XmlDocument singleFax = new System.Xml.XmlDocument();
singleFax.Load(Path.Combine(Application.StartupPath, NameOfFile.xml));
The XML file I load in the code above needs to be installed with the
apllication... how do I add the XML file to the deploy? Right now, I just
use the "Publish Now" feature by selecting properties and clicking the
"Publish" tab in the project file... I'm just not sure how to add this file
(the XML file) to the deployment "package".
Thanks in advance!
Brian
Re: Smart client deploy question
am 22.01.2008 09:00:20 von Marc Gravell
In project properties, go into the Publish tab and select Application
Files...; now ensure that your file is marked "Include (Auto)" or
"Include"
If it doesn't appear, try marking it as "Content" in the solution
explorer..
Marc
Re: Smart client deploy question
am 24.01.2008 07:49:17 von RobinS
Also, in the properties for the file in the Solution Explorer, mark it as
"copy always".
Make sure in the Application Files that is marked Include, and not as a data
file. If it is a data file, it will put it in a separate area when it
deploys it. This is the default for xml files, so you have to change it.
RobinS.
-------------------------
"Marc Gravell" wrote in message
news:O0xZbxMXIHA.5980@TK2MSFTNGP04.phx.gbl...
> In project properties, go into the Publish tab and select Application
> Files...; now ensure that your file is marked "Include (Auto)" or
> "Include"
>
> If it doesn't appear, try marking it as "Content" in the solution
> explorer..
>
> Marc
>
Re: Smart client deploy question
am 24.01.2008 16:44:41 von Andrej Tozon
I'd say when dealing with data/conent files it's better to compile
them as "data files" and use DataDirectory instead of StartupPath to
load them. Just to keep application and data files separate.
Andrej
Re: Smart client deploy question
am 25.01.2008 08:41:50 von RobinS
I'd say it depends on what is in the XML file. For example, we have menu
options in an XML file. They don't change, they aren't updated when the
application runs. These should be deployed as part of the application.
If you were persisting XML with datasets, or a SQLServer database, or
something like that, I could see it. But the OP's file seems to be a
configuration-type file. I stand by my assertion.
RobinS.
----------------
"Andrej Tozon" wrote in message
news:1fad6599-f879-4032-8781-6e5927de0ef1@c23g2000hsa.google groups.com...
> I'd say when dealing with data/conent files it's better to compile
> them as "data files" and use DataDirectory instead of StartupPath to
> load them. Just to keep application and data files separate.
>
> Andrej