473,387 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

EnterpriseLibrary

Ben
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

Jul 25 '06 #1
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
Jul 25 '06 #2
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

Jul 25 '06 #3
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


Jul 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
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...
2
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....
2
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...
2
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...
0
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...
0
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...
0
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...
0
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? ...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
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...
0
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
0
BarryA
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...
1
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...
0
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...
0
marktang
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,...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.