Groups | Blog | Home
all groups > dotnet general > february 2008 >

dotnet general : App config not seen when running from a logical drive on Vista??


José_Joye
2/28/2008 2:11:47 PM
I'm currently facing a problem when runnning an application on Vista from a
logical drive (created with "subst").
The problem occurs when the application is run from command prompt. All is
ok if the application is run from the debugger.

Say I have an application that is located under
C:\temp\TestForSubst\TestForSubst\bin\debug
Then I create a logical drive:
[quoted text, click to view]

If I do the following:
[quoted text, click to view]

If I do the following:
[quoted text, click to view]

Thanks a lot for any feedback!
- José

Here is my sample program:
===================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Configuration;
using System.Collections.Specialized;

namespace TestForSubst
{
class Program
{
// Show how to use AppSettings.
static void DisplayAppSettings()
{

// Get the AppSettings collection.
NameValueCollection appSettings = ConfigurationManager.AppSettings;

string[] keys = appSettings.AllKeys;

Console.WriteLine();
Console.WriteLine("Application appSettings:");

// Loop to get key/value pairs.
for (int i = 0; i < appSettings.Count; i++)
{
Console.WriteLine("#{0} Name: {1} Value: {2}", i, keys[i],
appSettings[i]);
}
}


static void Main(string[] args)
{
string currDir = Directory.GetCurrentDirectory();
Console.WriteLine("Current dir: {0}", currDir);

string[] files = Directory.GetFiles(currDir);
if (files.Length > 0)
{
Console.WriteLine("Files in directory:");
foreach (string file in files)
{
Console.WriteLine(" " + file);
}

DisplayAppSettings();
Console.Write("Press <Enter> to quit");
Console.ReadLine();
}
}
}
}
José_Joye
3/10/2008 4:57:28 PM
Just as follow up, I have also posted it under following forum:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2944809&SiteID=1

This seems really to be a bug when the following configuration is used:
VS2008, Vista and application run from a logical drive (defined with
"Subst")
--> in such a case the content of the application config file is not seen.

The forum moderator was able to reproduce the problem and I have reported
the bug to MS using http://connect.microsoft.com/visualstudio/

José


"José Joye" <jose.joye__KILLTHESPAMS__SMAPSEHTLLIK__@bluewin.ch> wrote in
message news:496F4AC2-8EA2-49DF-B3C1-A0FFC58DB384@microsoft.com...
[quoted text, click to view]
AddThis Social Bookmark Button