Connecting Tech Pros Worldwide Help | Site Map

EnterpriseLibrary

Ben
Guest
 
Posts: n/a
#1: Jul 25 '06
Hi,
I wrote a C# application that is using the Data Access Application Block
Enterprise Library, Jan 2006.
When i'm running the application on my local machine everything works fine.
The problem occur when i'm trying to run the application from a remote
computer using shortcut, i get the following error:

System.TypeInitializationException: The type initializer for
'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory'
threw an exception. ---System.IO.FileLoadException: Could not load file or
assembly 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to
grant minimum permission requests. (Exception from HRESULT: 0x80131417)
File name: 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0,
Culture=neutral, PublicKeyToken=null' --->
System.Security.Policy.PolicyException: Required permissions cannot be
acquired.
at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
PermissionSet& denied, Boolean checkExecutionPermission)
at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
PermissionSet& denied, Int32& securitySpecialFlags, Boolean
checkExecutionPermission)
at
Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.EnterpriseLibraryFactory..c ctor()
--- End of inner exception stack trace ---
at
Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.EnterpriseLibraryFactory.Bu ildUp[T](String
id, IConfigurationSource configurationSource)
at
Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.NameTypeFactoryBase`1.Creat e(String name)
at
Microsoft.Practices.EnterpriseLibrary.Data.Databas eFactory.CreateDatabase(String name)


Any help is welcome. Thanks!
Ben

Marc Gravell
Guest
 
Posts: n/a
#2: Jul 25 '06

re: EnterpriseLibrary


Sounds like you don't trust the remote location (network apps run in more of
a sandbox by default); in 2.0 I would suggest using ClickOnce, signing the
manifest and specifying an appropriate trust level; otherwise you can use
caspol or the configuration wizard (in the start menu, or there is an MMC
plugin), and specify a runtime security policy based e.g. on the network
path (url?) or signature of the app you want to run.

Marc


Nicholas Paldino [.NET/C# MVP]
Guest
 
Posts: n/a
#3: Jul 25 '06

re: EnterpriseLibrary


Ben,

When you are running an application from a remote computer, it does not
run with full trust. You will have to launch the application from your
local computer or go to the .NET Framework Administration tool and configure
the framework to grant your assembly the permissions you require.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"Ben" <Ben@discussions.microsoft.comwrote in message
news:75AD0E50-A13E-4B87-A83A-E86442B9F31F@microsoft.com...
Quote:
Hi,
I wrote a C# application that is using the Data Access Application Block
Enterprise Library, Jan 2006.
When i'm running the application on my local machine everything works
fine.
The problem occur when i'm trying to run the application from a remote
computer using shortcut, i get the following error:
>
System.TypeInitializationException: The type initializer for
'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory'
threw an exception. ---System.IO.FileLoadException: Could not load file
or
assembly 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed
to
grant minimum permission requests. (Exception from HRESULT: 0x80131417)
File name: 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0,
Culture=neutral, PublicKeyToken=null' --->
System.Security.Policy.PolicyException: Required permissions cannot be
acquired.
at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
PermissionSet& denied, Boolean checkExecutionPermission)
at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
PermissionSet& denied, Int32& securitySpecialFlags, Boolean
checkExecutionPermission)
at
Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.EnterpriseLibraryFactory..c ctor()
--- End of inner exception stack trace ---
at
Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.EnterpriseLibraryFactory.Bu ildUp[T](String
id, IConfigurationSource configurationSource)
at
Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.NameTypeFactoryBase`1.Creat e(String
name)
at
Microsoft.Practices.EnterpriseLibrary.Data.Databas eFactory.CreateDatabase(String
name)
>
>
Any help is welcome. Thanks!
Ben
>

Ben
Guest
 
Posts: n/a
#4: Jul 26 '06

re: EnterpriseLibrary


Thank's both of you for the quick respond.
I tried to use the .NET Framework Administration tool to configure
the framework to grant the assembly the permissions,
but i get the following error:

Application attempted to perform and operation not allowed by the security
policy.
To grant this application the required permission, contact your system
administrator, or
use the Microsoft .NET Framework Configuration tool.
Hash for the assembly cannot be generated.

I also got this error message when i tried to grant permissions to local
assembly, while i'm a system administrator on my local machine.

Do you know what i'm missing?






"Nicholas Paldino [.NET/C# MVP]" wrote:
Quote:
Ben,
>
When you are running an application from a remote computer, it does not
run with full trust. You will have to launch the application from your
local computer or go to the .NET Framework Administration tool and configure
the framework to grant your assembly the permissions you require.
>
Hope this helps.
>
>
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
>
"Ben" <Ben@discussions.microsoft.comwrote in message
news:75AD0E50-A13E-4B87-A83A-E86442B9F31F@microsoft.com...
Quote:
Hi,
I wrote a C# application that is using the Data Access Application Block
Enterprise Library, Jan 2006.
When i'm running the application on my local machine everything works
fine.
The problem occur when i'm trying to run the application from a remote
computer using shortcut, i get the following error:

System.TypeInitializationException: The type initializer for
'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory'
threw an exception. ---System.IO.FileLoadException: Could not load file
or
assembly 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed
to
grant minimum permission requests. (Exception from HRESULT: 0x80131417)
File name: 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0,
Culture=neutral, PublicKeyToken=null' --->
System.Security.Policy.PolicyException: Required permissions cannot be
acquired.
at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
PermissionSet& denied, Boolean checkExecutionPermission)
at System.Security.SecurityManager.ResolvePolicy(Evid ence evidence,
PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset,
PermissionSet& denied, Int32& securitySpecialFlags, Boolean
checkExecutionPermission)
at
Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.EnterpriseLibraryFactory..c ctor()
--- End of inner exception stack trace ---
at
Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.EnterpriseLibraryFactory.Bu ildUp[T](String
id, IConfigurationSource configurationSource)
at
Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.NameTypeFactoryBase`1.Creat e(String
name)
at
Microsoft.Practices.EnterpriseLibrary.Data.Databas eFactory.CreateDatabase(String
name)


Any help is welcome. Thanks!
Ben
>
>
>
Closed Thread