Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. publishing resource folder [modified]

publishing resource folder [modified]

Scheduled Pinned Locked Moved .NET (Core and Framework)
questionlearning
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    ZenyukIV
    wrote on last edited by
    #1

    Dear All. When I publish an application, there are 2 root folders created something like the first one ...\Apps\2.0\N2NJKNK\JHKJ7897KJ\**appl..tion**_ace7blkjnjn_0100.0000_534535 - where my app.exe file stored and the second one ...\Apps\2.0\N2NJKNK\JHKJ7897KJ\**appl..exe**_ace7blkjnjn_0100.0000_7689767 - where my resource files stored (some.exe, data.sdf) So to access to my resource (eg data.sdf) I have to do like that: "..\\appl..exe_ace7blkjnjn_0100.0000_7689767\\data.sdf" The question: is there any proper way to get to that "...\**appl..exe**_..." folder

    modified on Friday, December 28, 2007 9:32:45 AM

    Z 1 Reply Last reply
    0
    • Z ZenyukIV

      Dear All. When I publish an application, there are 2 root folders created something like the first one ...\Apps\2.0\N2NJKNK\JHKJ7897KJ\**appl..tion**_ace7blkjnjn_0100.0000_534535 - where my app.exe file stored and the second one ...\Apps\2.0\N2NJKNK\JHKJ7897KJ\**appl..exe**_ace7blkjnjn_0100.0000_7689767 - where my resource files stored (some.exe, data.sdf) So to access to my resource (eg data.sdf) I have to do like that: "..\\appl..exe_ace7blkjnjn_0100.0000_7689767\\data.sdf" The question: is there any proper way to get to that "...\**appl..exe**_..." folder

      modified on Friday, December 28, 2007 9:32:45 AM

      Z Offline
      Z Offline
      ZenyukIV
      wrote on last edited by
      #2

      The solution is to use Application.UserAppDataPath instead of Application.StartupPath internal sealed partial class Settings { public Settings() { this.SettingsLoaded += new System.Configuration.SettingsLoadedEventHandler(Settings_SettingsLoaded); } void Settings_SettingsLoaded( object sender, System.Configuration.SettingsLoadedEventArgs e ) { String dataDirectory; if (( AppDomain.CurrentDomain.DomainManager != null ) && AppDomain.CurrentDomain.DomainManager.ToString().Contains("VSHost")) { dataDirectory = Application.StartupPath; } else { dataDirectory = **Application.UserAppDataPath**; } this["test1ConnectionString"] = Settings.Default.test1ConnectionString.Replace(".\\", dataDirectory + "\\"); } Thanks to http://blogs.msdn.com/smartclientdata/archive/2005/07/15/439008.aspx[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups