PC Review


Reply
Thread Tools Rate Thread

ClickOnce Deployement: Cann't resolve path for resource files.

 
 
moondaddy
Guest
Posts: n/a
 
      14th Mar 2006
I have a sample vb .net 2.0 winforms app and am using Oneclick deployment to
a remote server. All of the files (DLLs, EXEs, manifests, configs, etc.)
seem to get deployed to the target folder on the client OK and seem to work
OK, Except for some additional files I created for the client application.
For example, I have a file called myData.xml and myCustomConfix.xml which
the windows app uses. In the old 1.1 days (while working in the VS2003 IDE)
I put these files in the bin folder and the app would reference and use them
via a line of code like this:

Dim sMyDataFile As String = Directory.GetCurrentDirectory & "/myData.xml"
Dim sMyConfigFile As String = Directory.GetCurrentDirectory &
"/myCustomConfix.xml"

and sMyDataFile would be something like this:

"biglongpath/projectfolder/bin/myData.xml"

Then when I create an installation exe for the app and install it on the
client, all files (dlls, app files, myData.xml, and myCustomConfix.xml) are
all located in the in one single target folder on the client.

Now in .net .2.0 the path for:
Dim sMyDataFile As String = Directory.GetCurrentDirectory & "/myData.xml"
is:
"biglongpath/projectfolder/bin/Debug/myData.xml" (now in the bin/debug
folder)

and when oneclick installs in to the client all the files are installed
together under a single folder except for myData.xml and myCustomConfix.xml
which get installed in the bin/debug folder on the client.

The problem is the app still uses the same code to find those files
(Directory.GetCurrentDirectory & "/myData.xml" ) but this path resolves to
the main folder where the app exe is running and not the bin/debug folder.

Questions:

1) This seems to be a major functionality by design (how/where things run
from in the ide vs how/where the run on the client) Why isn't this better
documented on how to deal with this. I'm sure this is a common problem.

2) What is the proper way to deal with this?

Thanks.








--
(E-Mail Removed)am


 
Reply With Quote
 
 
 
 
Gary Chang[MSFT]
Guest
Posts: n/a
 
      16th Mar 2006
Hi,

>and when oneclick installs in to the client all the files
>are installed together under a single folder except for
>myData.xml and myCustomConfix.xml which get installed
>in the bin/debug folder on the client.
>
>2) What is the proper way to deal with this?


This behavior is by design. Unlike the VS2005 setup project file, the
ClickOnce project cannot specify its application file's installation
directory explicitly. Its installation package will persist the dev
project's folder structure to the client machine. Since your myData.xml and
myCustomConfix.xml exist in your dev project's bin/debug directory, its
ClickOnce installation package will also install them into the target
application directory's bin/debug folder.

To workaround this problem, I suggest you can move the myData.xml and
myCustomConfix.xml file into the project's directory(via the Solution
Explorer) when you want to publish that application, and make sure they
have been included(Data File (Auto)) in ClickOnce project's "Application
Files" list.


Thanks!

Best regards,

Gary Chang
Microsoft Community Support
======================================================
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
======================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DFS share resource cann't able to access from vista client m/c subi_v Windows Vista Performance 0 29th Mar 2008 09:44 AM
ASP.NET Application using Virtual path provider Deployement Problem on IIS windows Server 2003 Ibrahim Microsoft ASP .NET 1 14th Apr 2007 06:19 AM
problem deployement ASP.NET2 Application used Virtual path provid =?Utf-8?B?SWJyYWhpbQ==?= Microsoft ASP .NET 1 21st Mar 2007 06:04 AM
ClickOnce fails on assembly containing Win32 resource =?Utf-8?B?Q29saXZpZXI=?= Microsoft Dot NET 0 26th Jan 2007 10:06 AM
clickonce and ocx deployement Pascal Microsoft VB .NET 0 15th Dec 2006 06:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:18 PM.