Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - System.ArgumentException in Environment.GetFolderPath

Reply
 
Old 06-03-2009   #1 (permalink)
Thorsten Prölß


 
 

System.ArgumentException in Environment.GetFolderPath

Hello,

I have an issue using a typed dataset. Accessing the connection property of
the related TableAdapter, I get a System.ArgumentException.
The code does well on hundreds of pc's. Only on one customer pc we have this
specific issue. The affected machine has an Windows XP OS with .NET 2.0.

The exception:
Type: System.ArgumentException
Message:
Absolute path information is required.
Class: System.Security.Util.StringExpressionSet
Method: System.Collections.ArrayList
CreateListFromExpressions(System.String[], Boolean)
Assembly: mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
StackTrace:
at
System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[]
str, Boolean needFullPath)
at
System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess
access, AccessControlActions control, String[] pathListOrig, Boolean
checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at
System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
access, String path)
at System.Environment.GetFolderPath(SpecialFolder folder)
at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean
includeUserConfig)
at System.Configuration.ClientConfigPaths.GetPaths(String exePath,
Boolean includeUserConfig)
at
System.Configuration.Internal.ConfigurationManagerInternal.System.Configuration.Internal.IConfigurationManagerInternal.get_ExeProductName()
at System.Configuration.ApplicationSettingsBase.get_Initializer()
at
System.Configuration.ApplicationSettingsBase.CreateSetting(PropertyInfo
propInfo)
at System.Configuration.ApplicationSettingsBase.EnsureInitialized()
at System.Configuration.ApplicationSettingsBase.get_Properties()
at System.Configuration.SettingsBase.GetPropertyValueByName(String
propertyName)
at System.Configuration.SettingsBase.get_Item(String propertyName)
at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String
propertyName)
at System.Configuration.ApplicationSettingsBase.get_Item(String
propertyName)
at Datev.Pegnitz.Properties.Settings.get_UAConnectionStringForDevelopment()
at
Datev.Pegnitz.Transfer.ProductTableAdapters.ProductsTableAdapter.get_Connection()
at
Datev.Pegnitz.DataAccess.DataManager.Datev.Pegnitz.DataAccess.IDataManager.GetProductsByDerivat(String licenseComponentId)
at Datev.Pegnitz.Business.ApplicationStartup.FillProductInformation()

I have made a demo exe and run it on the client's pc to enclose this
issue. The exe is a simple WinForm, with a button click calling
System.Environment.GetFolderPath(ApplicationData).
This call causes following exception:

ApplicationData
Exception:
Message:
Absolute path information is required.
Source
mscorlib
StackTrace
at
System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[]
str, Boolean needFullPath)
at
System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess
access, AccessControlActions control, String[] pathListOrig, Boolean
checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at
System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
access, String path)
at System.Environment.GetFolderPath(SpecialFolder folder)
at Pfadermittlung.Form1.showFolders()

Calling GetFolderPath for all other values of Environment.SpecialFolder
(e.g. Programs, Desktop, MyDocuments ...) does work well.
Ok, it seems to be somthing wrong with the ApplicationData-path.

How can I find out what .Net thinks, the ApplicationData-Path is? Is there
a registry setting for this path?
Is this a security issu or is it an issue with syntactical wrong path
information like e.g. missing backslash between drive letter and folder path?

Thorsten

My System SpecsSystem Spec
Old 06-05-2009   #2 (permalink)
Thorsten Prölß


 
 

RE: System.ArgumentException in Environment.GetFolderPath

Ok, we found the problem.
Changing the registry value
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell
Folders\AppData from O: to O:\ fixed this issue.

"Thorsten Prölß" wrote:
Quote:

> Hello,
>
> I have an issue using a typed dataset. Accessing the connection property of
> the related TableAdapter, I get a System.ArgumentException.
> The code does well on hundreds of pc's. Only on one customer pc we have this
> specific issue. The affected machine has an Windows XP OS with .NET 2.0.
>
> The exception:
> Type: System.ArgumentException
> Message:
> Absolute path information is required.
> Class: System.Security.Util.StringExpressionSet
> Method: System.Collections.ArrayList
> CreateListFromExpressions(System.String[], Boolean)
> Assembly: mscorlib, Version=2.0.0.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089
> StackTrace:
> at
> System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[]
> str, Boolean needFullPath)
> at
> System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess
> access, AccessControlActions control, String[] pathListOrig, Boolean
> checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
> at
> System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
> access, String path)
> at System.Environment.GetFolderPath(SpecialFolder folder)
> at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean
> includeUserConfig)
> at System.Configuration.ClientConfigPaths.GetPaths(String exePath,
> Boolean includeUserConfig)
> at
> System.Configuration.Internal.ConfigurationManagerInternal.System.Configuration.Internal.IConfigurationManagerInternal.get_ExeProductName()
> at System.Configuration.ApplicationSettingsBase.get_Initializer()
> at
> System.Configuration.ApplicationSettingsBase.CreateSetting(PropertyInfo
> propInfo)
> at System.Configuration.ApplicationSettingsBase.EnsureInitialized()
> at System.Configuration.ApplicationSettingsBase.get_Properties()
> at System.Configuration.SettingsBase.GetPropertyValueByName(String
> propertyName)
> at System.Configuration.SettingsBase.get_Item(String propertyName)
> at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String
> propertyName)
> at System.Configuration.ApplicationSettingsBase.get_Item(String
> propertyName)
> at Datev.Pegnitz.Properties.Settings.get_UAConnectionStringForDevelopment()
> at
> Datev.Pegnitz.Transfer.ProductTableAdapters.ProductsTableAdapter.get_Connection()
> at
> Datev.Pegnitz.DataAccess.DataManager.Datev.Pegnitz.DataAccess.IDataManager.GetProductsByDerivat(String licenseComponentId)
> at Datev.Pegnitz.Business.ApplicationStartup.FillProductInformation()
>
> I have made a demo exe and run it on the client's pc to enclose this
> issue. The exe is a simple WinForm, with a button click calling
> System.Environment.GetFolderPath(ApplicationData).
> This call causes following exception:
>
> ApplicationData
> Exception:
> Message:
> Absolute path information is required.
> Source
> mscorlib
> StackTrace
> at
> System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[]
> str, Boolean needFullPath)
> at
> System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess
> access, AccessControlActions control, String[] pathListOrig, Boolean
> checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
> at
> System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
> access, String path)
> at System.Environment.GetFolderPath(SpecialFolder folder)
> at Pfadermittlung.Form1.showFolders()
>
> Calling GetFolderPath for all other values of Environment.SpecialFolder
> (e.g. Programs, Desktop, MyDocuments ...) does work well.
> Ok, it seems to be somthing wrong with the ApplicationData-path.
>
> How can I find out what .Net thinks, the ApplicationData-Path is? Is there
> a registry setting for this path?
> Is this a security issu or is it an issue with syntactical wrong path
> information like e.g. missing backslash between drive letter and folder path?
>
> Thorsten
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
The system could not find the environment option that was entered Vista General
System.Environment.Commandline not available .NET General
Changing system environment variables Vista account administration
The system could not find the environment option that was entered Vista account administration
Environment.GetFolderPath returns wrong path .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46