1

I have a WPF application that is deployed via click-once. On a couple of laptops, when the application runs, it crashes at the login screen because it doesn't properly resolve the image paths for the screen. The path it thinks its looking for is "C:\Users\images\image.jpg". What it should be looking for is the click-once install directory... something like "C:\users\<username>\Appdata\local\apps\2.0\<Click once generated path>\images\" etc...

anybody run into a similar issue? Is it a permissions thing? The user says they are running as an admin.

any help would be appreciated.

Scot
  • 572
  • 1
  • 7
  • 27
  • I will add that this is isolated two just two laptops that I don't have direct access to. Other installations are fine. – Scot May 20 '11 at 17:35

3 Answers3

0

Firstly, set the Build Action type of your files as content type. Then, try to refer them using Application.startuppath from your application.

Manish Dubey
  • 706
  • 4
  • 17
0

if you want to read image from local directory you can use "|DataDirectory|\images\etc.*"

Akrem
  • 5,033
  • 8
  • 37
  • 64
  • I don't want to read an image, this is an image resource in the WPF app, it has a relative path of \images\MyImage.jpg. It is like clickonce or WPF or something in between is not resolving the path properly. I just can't figure out where. – Scot May 20 '11 at 17:18
0

I don't know a concrete answer, but I'll just throw out a couple of things which might be worth trying. Compare the user names on the laptops that don't work to the user names being used on the ones that do. Are there spaces or funny characters? Does the folder name match the username under the \users folder? If you login as the user, check to see do you have read and execute permissions on the folders containing the images? Really open those files when logged in as the user.

Richard Brightwell
  • 3,012
  • 2
  • 20
  • 22