C
Chris
I have seen the posts on various places on the internet about .NET
framework mismatch issues and I don't think that is my problem. ; )
When I execute the following C++.NET code:
String *ipAddress = S"";
IDictionary *server_config =
dynamic_cast<IDictionary*>(ConfigurationSettings::GetConfig("ServerAddress")
);
ipAddress = dynamic_cast<String*>(server_config->get_Item(S"IP"));
I get the following .NET Framework exception on some computers:
Error loading XML file
c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config Request
for the permission of type
System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
Version=1.90.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.
(C:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config)
Details window:
************** Exception Text **************
System.Configuration.ConfigurationException: Error loading XML file
c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config Request for
the permission of type
System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
(c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config)
at System.Configuration.ConfigurationSettings.GetConfig(String
sectionName)
I am using the following app.config file (named appropriately for my
application of course):
<configuration>
<configSections>
<section name="ServerAddress"
type="System.Configuration.SingleTagSectionHandler,System" />
<section name="IFacAddress"
type="System.Configuration.SingleTagSectionHandler,System" />
<section name="LogFile"
type="System.Configuration.SingleTagSectionHandler,System" />
</configSections>
<ServerAddress IP="10.0.0.41" Port="443" />
<IFacAddress IP="" Port="300" />
<LogFile dir="C:\\serv\\Server\\logs" name="Server.log"/>
<system.net>
<connectionManagement>
<add address="*" maxconnection="200" />
</connectionManagement>
</system.net>
<system.runtime.remoting>
<application>
<client>
<wellknown type="DBIISRemotingService.DBService,
DBIISRemotingService"
url="http://10.0.0.29:30303/DBIISRemotingService/DBService.rem" />
</client>
<channels>
<channel ref="http" port="0">
<clientProviders>
<formatter ref="binary" />
</clientProviders>
</channel>
</channels>
</application>
<customErrors mode="off" />
</system.runtime.remoting>
<startup>
<supportedRuntime version="V1.1.4322" />
</startup>
</configuration>
I can't seem to figure out what the problem is. I don't particularly
want to even access the machine.config file, I want the data that is in the
app.config file. Surely I don't need to have StrongNameIdentity permissions
to read my own app.config file. I have check the .NET framework permissions
and as far as I can tell the assembly is running with full trust so it
should have all the permissions it needs. The code above is executed from
within a .NET dll, which is called by a .NET application, perhaps that is
the problem.
If you need any more info I'd be happy to post it.
Thanks,
-Chris
framework mismatch issues and I don't think that is my problem. ; )
When I execute the following C++.NET code:
String *ipAddress = S"";
IDictionary *server_config =
dynamic_cast<IDictionary*>(ConfigurationSettings::GetConfig("ServerAddress")
);
ipAddress = dynamic_cast<String*>(server_config->get_Item(S"IP"));
I get the following .NET Framework exception on some computers:
Error loading XML file
c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config Request
for the permission of type
System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
Version=1.90.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.
(C:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config)
Details window:
************** Exception Text **************
System.Configuration.ConfigurationException: Error loading XML file
c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config Request for
the permission of type
System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
(c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config)
at System.Configuration.ConfigurationSettings.GetConfig(String
sectionName)
I am using the following app.config file (named appropriately for my
application of course):
<configuration>
<configSections>
<section name="ServerAddress"
type="System.Configuration.SingleTagSectionHandler,System" />
<section name="IFacAddress"
type="System.Configuration.SingleTagSectionHandler,System" />
<section name="LogFile"
type="System.Configuration.SingleTagSectionHandler,System" />
</configSections>
<ServerAddress IP="10.0.0.41" Port="443" />
<IFacAddress IP="" Port="300" />
<LogFile dir="C:\\serv\\Server\\logs" name="Server.log"/>
<system.net>
<connectionManagement>
<add address="*" maxconnection="200" />
</connectionManagement>
</system.net>
<system.runtime.remoting>
<application>
<client>
<wellknown type="DBIISRemotingService.DBService,
DBIISRemotingService"
url="http://10.0.0.29:30303/DBIISRemotingService/DBService.rem" />
</client>
<channels>
<channel ref="http" port="0">
<clientProviders>
<formatter ref="binary" />
</clientProviders>
</channel>
</channels>
</application>
<customErrors mode="off" />
</system.runtime.remoting>
<startup>
<supportedRuntime version="V1.1.4322" />
</startup>
</configuration>
I can't seem to figure out what the problem is. I don't particularly
want to even access the machine.config file, I want the data that is in the
app.config file. Surely I don't need to have StrongNameIdentity permissions
to read my own app.config file. I have check the .NET framework permissions
and as far as I can tell the assembly is running with full trust so it
should have all the permissions it needs. The code above is executed from
within a .NET dll, which is called by a .NET application, perhaps that is
the problem.
If you need any more info I'd be happy to post it.
Thanks,
-Chris