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 3 8321
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
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]
- mv*@spam.guard.caspershouse.com
"Ben" <Be*@discussions.microsoft.comwrote in message
news:75**********************************@microsof t.com...
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
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:
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]
- mv*@spam.guard.caspershouse.com
"Ben" <Be*@discussions.microsoft.comwrote in message
news:75**********************************@microsof t.com...
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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mairead O' Donovan |
last post by:
From: davidkeaveny@gmail.com (CtrlAltDel)
Newsgroups: microsoft.public.dotnet.datatools
Subject: Unit-testing applications that use the
Microsoft.Patterns.EnterpriseLibrary.Data
Date: 15 Apr 2005...
|
by: Jake_adl |
last post by:
Is there any way to create a
Microsoft.Practices.EnterpriseLibrary.Data.Database object without reading
from a configuration file?
I am writing a utility that manages databases in SQL Server....
|
by: js |
last post by:
I got this error when I moved my application to a new Windows 2003
server. I installed and recompiled the
'Microsoft.Practices.EnterpriseLibrary - June 2005" then added these
assemblies to the...
|
by: A TO Consultant |
last post by:
Hi All,
We are using Microsoft.Practices.EnterpriseLibrary.Logging version 1.1.0.0
successfully with .NET code. There is a problem when we try to log from
non-.NET code through interop. We get...
|
by: job |
last post by:
Mohamed Sharaf's has produced a Microsoft.Practices.EnterpriseLibrary
production server installer:
https://blogs.msdn.com/mohamed_sharafs_blog/archive/2005/09/18/470854.aspx
Running the...
|
by: rajesh.hanchate |
last post by:
Please help me in resolving this issue.
I am using EnterpriseLibrary 2.0 Exception and logging block for
logging exceptions to event log. It works fine for sometime. After some
time it stops...
|
by: Karthik |
last post by:
Hi all,
I am novice to the VB .net
I don't know How to create a Connection with SQL server Using the
Microsoft.Practise.EnterpriseLibrary?
Where do i give the ConnectionString?
I am...
|
by: sloan |
last post by:
Is anyone else using the Microsoft Practices EnterpriseLibrary conventions
for naming FILES (.cs) as far as a non-generic and generic implementation is
concerned?
Anyone have an alternative?
...
|
by: =?Utf-8?B?cmFuZHkxMjAw?= |
last post by:
Can anyone offer pointers to articles/examples of passing a Ref Cursor
***IN*** to an Oracle stored procedure. I find tons of examples for getting a
ref cursor OUT of a stored procedure. I'm using...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |