Springframework .NET 4.0 console application from a intranet share - .net-4.0

I've recently migrated a .NET 3.5 console application, which uses spring and nhiberate to .NET 4.0. This application ran fine off of network shares under .net 3.5 and off of a local drive under .net 4.0, however once I migrated it to .net 4.0, I get the following error at startup from a network share:
Unhandled Exception: System.TypeInitializationException: The type initializer for 'Spring.Context.Support.ContextRegistry' threw an exception.
---> Common.Logging.ConfigurationException: Failed obtaining configuration for Common.Logging from configuration section 'common/logging'.
---> System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for common/logging: That assembly does not allow partially trusted callers. (Z:\Tools\SaaSDataPoster\SaaSDataPoster.exe.Config line 6)
---> System.Security.SecurityException: That assembly does not allow partially trusted callers.
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Configuration.TypeUtil.CreateInstanceWithReflectionPermission(Type type)
at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.Init(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.InitWithRestrictedPermissions(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
at System.Configuration.RuntimeConfigurationRecord.CreateSectionFactory(FactoryRecord factoryRecord)
at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)
--- End of inner exception stack trace ---
at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at Common.Logging.LogManager.<>c__DisplayClass3.<BuildLoggerFactoryAdapter>b__0()
at Common.Logging.Configuration.ArgUtils.<>c__DisplayClass13.<Guard>b__12()
at Common.Logging.Configuration.ArgUtils.Guard[T](Function`1 function, String messageFormat, Object[] args)
--- End of inner exception stack trace ---
at Common.Logging.Configuration.ArgUtils.Guard[T](Function`1 function, String messageFormat, Object[] args)
at Common.Logging.LogManager.BuildLoggerFactoryAdapter()
at Common.Logging.LogManager.get_Adapter()
at Common.Logging.LogManager.GetLogger(Type type)
at Spring.Context.Support.ContextRegistry..cctor() in c:\_prj\spring- net\trunk\src\Spring\Spring.Core\Context\Support\ContextRegistry.cs:line 60
--- End of inner exception stack trace ---
at Spring.Context.Support.ContextRegistry.GetContext()
I've tried adding <NetFx40_LegacySecurityPolicy enabled="true" /> and using CasPol.exe to give the intranet zone full trust (This worked when the app was .net 2.0).
I'm using the spring.net binaries that are compiled for .net 4.0 as well.
My assemblies all have a strong name as well. I'm not sure if that helps or hurts.
The IsFullTrusted property of my executing assembly returns true as well.
Has anyone had any luck with spring, net 4.0, and network shares?
Below is the output from caspol -m -lg:
32-bit:
Code Groups:
1. All code: Nothing
1.1. Zone - MyComputer: FullTrust
1.1.1. StrongName - 002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293: FullTrust
1.1.2. StrongName - 00000000000000000400000000000000: FullTrust
1.2. Zone - Intranet: FullTrust
1.2.1. All code: Same site Web
1.2.2. All code: Same directory FileIO - 'Read, PathDiscovery'
1.3. Zone - Internet: Internet
1.3.1. All code: Same site Web
1.4. Zone - Untrusted: Nothing
1.5. Zone - Trusted: Internet
1.5.1. All code: Same site Web
64-bit:
Code Groups:
1. All code: Nothing
1.1. Zone - MyComputer: FullTrust
1.1.1. StrongName - 002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293: FullTrust
1.1.2. StrongName - 00000000000000000400000000000000: FullTrust
1.2. Zone - Intranet: FullTrust
1.2.1. All code: Same site Web
1.2.2. All code: Same directory FileIO - 'Read, PathDiscovery'
1.3. Zone - Internet: Internet
1.3.1. All code: Same site Web
1.4. Zone - Untrusted: Nothing
1.5. Zone - Trusted: Internet
1.5.1. All code: Same site Web

I partially solved this problem by adding AllowPartiallyTrustedCallersAttribute to the assemblies containing the types used to deserialize the config sections.

Related

FileLoadException during activation of WCF service

After deploying my WCF service in IIS, I get this error when accessing the service:
Server Error in '/MyService' Application.
The given assembly name or codebase was invalid. (Exception from
HRESULT: 0x80131047) Description: An unhandled exception occurred
during the execution of the current web request. Please review the
stack trace for more information about the error and where it
originated in the code.
Exception Details: System.IO.FileLoadException: The given assembly
name or codebase was invalid. (Exception from HRESULT: 0x80131047)
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[FileLoadException: The given assembly name or codebase was invalid.
(Exception from HRESULT: 0x80131047)]
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean
loadTypeFromPartialName, ObjectHandleOnStack type) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean
loadTypeFromPartialName) +153 System.Type.GetType(String typeName)
+89 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +936
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo
serviceActivationInfo, EventTraceActivity eventTraceActivity) +76
System.ServiceModel.HostingManager.EnsureServiceAvailable(String
normalizedVirtualPath, EventTraceActivity eventTraceActivity) +901
[ServiceActivationException: The service '/MyService/MySvcImpl.svc'
cannot be activated due to an exception during compilation. The
exception message is: The given assembly name or codebase was invalid.
(Exception from HRESULT: 0x80131047).]
System.Runtime.AsyncResult.End(IAsyncResult result) +650220
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult
result) +210733
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult
ar) +166
I turned on the Assembly Binding Log Viewer (FUSLOGVW.EXE), but it does not show me any binding failures. Anyone any idea what could cause this, or how to debug this?
Found the issue! Posting here as it may help someone someday.
My web.config contains a service activation element with a factory attribute like this:
<serviceHostingEnvironment>
<serviceActivations>
<add relativeAddress="MyService.SvcImpl.svc"
service="MyService.SvcImpl"
factory="MyCompany.MyServiceHostFactory, MyCompany.MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=" />
</serviceActivations>
</serviceHostingEnvironment>
The factory attribute contains a class reference from a strongly named assembly. However, the PublicKeyToken atribute was supposed to be set by the build system to the correct value, depending on whether a test signing cert or the official signing cert was used.
The build step somehow failed and left the strong name of the assembly invalid. So, the first part of the message in the exception was pretty acurate. It just did not tell me which assembly could not be loaded. Nor was FUSLOGVW.EXE any helpful here.
I have the same problem when I tried to reference a file in this location 'AppCode/Authentication' but when I changed the name of the folder to 'App_Code/Authentication' the problem was resolved.

Unable to authenticate to RavenDB server on local network

I am attempting to connect to RavenDB on Server2 from Server1.
On Server2 I have created a new user "RavenDBUser" and granted them read/write access to the Database directory within the RavenDB installation.
I am running RavenDB as the windows service on port 8080.
On Server1 I have set the connection string for my application to:
Url=http://server2:8080;Database=MyDatabase;Domain=server2;user=RavenDBUser;password=mypassword;
When I run my application, I get a 403, forbidden error.
However, I am able to connect to the RavenDB Studio from Server1 and view "MyDatabase" after authenticating as "RavenDBUser".
The error details can be seen below:
[WebException: The remote server returned an error: (403) Forbidden.]
System.Net.HttpWebRequest.GetResponse() +8522396
Raven.Client.Connection.HttpJsonRequest.ReadJsonInternal(Func1
getResponse) +805
Raven.Client.Connection.HttpJsonRequest.ReadResponseJson() +587
Raven.Client.Connection.ServerClient.DirectPutIndex(String name,
String operationUrl, Boolean overwrite, IndexDefinition definition)
+774 Raven.Client.Connection.<>c__DisplayClass50.<PutIndex>b__4f(String
operationUrl) +36
Raven.Client.Connection.ReplicationInformer.TryOperation(Func2
operation, String operationUrl, Boolean avoidThrowing, T& result) +194
Raven.Client.Connection.ReplicationInformer.ExecuteWithReplication(String
method, String primaryUrl, Int32 currentRequest, Int32
currentReadStripingBase, Func2 operation) +526
Raven.Client.Connection.ServerClient.ExecuteWithReplication(String
method, Func2 operation) +138
Raven.Client.Indexes.AbstractIndexCreationTask.Execute(IDatabaseCommands
databaseCommands, DocumentConvention documentConvention) +86
Raven.Client.Indexes.IndexCreation.CreateIndexes(ExportProvider
catalogToGetnIndexingTasksFrom, IDatabaseCommands databaseCommands,
DocumentConvention conventions) +108
MyApp.CMSRegistry.InitializeStore() +380 MyApp.CMSRegistry..ctor()
+66
It seems the missing piece was that you have to explicitly enable the windows user/group in the RavenDB system database configuration.
The not so easy to find docs for doing this can be found at http://ravendb.net/docs/studio/multi-database about 3/4 down the page.

WCF Service is showing error after implemented in IIS

In my project I am using Enterprise Library to connect to database. It is working fine when I run the application from Visual Studio directly.
But this is showing error connecting to database when hosted in IIS on same machine. I have added log trace and got the following error
Resolution of the dependency failed, type =
"Microsoft.Practices.EnterpriseLibrary.Data.Database", name =
"(none)". Exception occurred while: while resolving. Exception is:
InvalidOperationException - The type Database cannot be constructed.
You must configure the container to supply this value.
----------------------------------------------- At the time of the
exception, the container was:
Resolving Microsoft.Practices.EnterpriseLibrary.Data.Database,(none)
| Exception:Microsoft.Practices.ServiceLocation.ActivationException:
Activation error occured while trying to get instance of type
Database, key "" --->
Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the
dependency failed, type =
"Microsoft.Practices.EnterpriseLibrary.Data.Database", name =
"(none)". Exception occurred while: while resolving. Exception is:
InvalidOperationException - The type Database cannot be constructed.
You must configure the container to supply this value.
----------------------------------------------- At the time of the
exception, the container was:
Resolving Microsoft.Practices.EnterpriseLibrary.Data.Database,(none)
---> System.InvalidOperationException: The type Database cannot be
constructed. You must configure the container to supply this value.
at
Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.GuardTypeIsNonPrimitive(IBuilderContext
context, SelectedConstructor selectedConstructor) at
Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.PreBuildUp(IBuilderContext
context) at
Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext
context) at
Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlanCreatorPolicy.CreatePlan(IBuilderContext
context, NamedTypeBuildKey buildKey) at
Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext
context) at
Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext
context) at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type
t, Object existing, String name, IEnumerable1 resolverOverrides)
--- End of inner exception stack trace --- at
Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object
existing, String name, IEnumerable1 resolverOverrides) at
Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, String
name, IEnumerable`1 resolverOverrides) at
Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type
serviceType, String key) --- End of inner exception stack trace ---
at
Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type
serviceType, String key) at
Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService](String
key) at
Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.InnerCreateDatabase(String
name)
My web.config of service is contains as below
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data"/>
</configSections>
<dataConfiguration defaultDatabase="OracleConnection">
<providerMappings>
<add databaseType="Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase, Microsoft.Practices.EnterpriseLibrary.Data" name="Oracle.DataAccess.Client"/>
</providerMappings>
</dataConfiguration>
<connectionStrings>
<add name="OracleConnection" providerName="Oracle.DataAccess.Client" connectionString="User Id=***;Password=****;Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=*****)(PORT=1500)) (CONNECT_DATA=(SERVER = DEDICATED) (SERVICE_NAME =*****)));"/>
<add name="SybaseConnection" connectionString="providerName=Sybase.ASEOLEDBProvider;Server=****;Port=5050;Catalog=**;User Id=***;Password=****"/>
</connectionStrings>
I tried a lot but unable to find the cause of issue. :(
I checked the permission on the folder and Everyone has full control. WCF Service in IIS Anonymous access is enabled.
Could anyone please help?
The assembly you are using cannot find one of the assemblies it depends on, make sure all dependencies are either in the GAC or in the bin folder of your web app.
When i enabled 32 bit applications in IIS the error has been changed to
ORA-12638: Credential retrieval failed
The connection string is correct which is working with visual studio.
Is there any setting we need to do in Oralce part to acces connection from IIS?
This worked fine when updated sqlnet.ora file of oracle.

Clickonce installation fails after addition of WCF service project

So I have a winform solution, deployed via clickonce.
Eveything worked fine until i added a WCF project. (see error in parsing the manifest file at end of post)
Now I notice that MSBuild compiles the service into a _PublishedWebsites dir.
I don't know what the need for this is, but I am suspecting this is the cause of the problem. This wcf project references some other projects within the solution.
I am actually hosting the wcf service within the application so I don't really need MSBuild to do all this for me.
Any ideas?
=====================================================================================
PLATFORM VERSION INFO
Windows : 5.1.2600.131072 (Win32NT)
Common Language Runtime : 2.0.50727.3603
System.Deployment.dll : 2.0.50727.3053 (netfxsp.050727-3000)
mscorwks.dll : 2.0.50727.3603 (GDR.050727-3600)
dfdll.dll : 2.0.50727.3053 (netfxsp.050727-3000)
dfshim.dll : 2.0.50727.3053 (netfxsp.050727-3000)
SOURCES
Deployment url : file:///C:/applications/abc/dev/abc.Application.application
IDENTITIES
Deployment Identity : Flow Management System.app, Version=1.4.0.0, Culture=neutral, PublicKeyToken=8453086392175e0f, processorArchitecture=msil
APPLICATION SUMMARY
* Installable application.
* Trust url parameter is set.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\applications\abc\dev\abc.Application.application resulted in exception. Following failure messages were detected:
+ Exception reading manifest from file:///C:/applications/abc/dev/1.4.0.0/abc.Application.exe.manifest: the manifest may not be valid or the file could not be opened.
+ Parsing and DOM creation of the manifest resulted in error. Following parsing errors were noticed:
-HRESULT: 0x80070c81
Start line: 0
Start column: 0
Host file:
+ Exception from HRESULT: 0x80070C81
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [12/03/2010 6:33:53 PM] : Activation of C:\applications\abc\dev\abc.Application.application has started.
* [12/03/2010 6:33:53 PM] : Processing of deployment manifest has successfully completed.
* [12/03/2010 6:33:53 PM] : Installation of the application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [12/03/2010 6:33:53 PM] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- Exception reading manifest from file:///C:/applications/abc/dev/1.4.0.0/abc.Application.exe.manifest: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
at System.Deployment.Application.DownloadManager.DownloadManifest(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ManifestType manifestType, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- Parsing and DOM creation of the manifest resulted in error. Following parsing errors were noticed:
-HRESULT: 0x80070c81
Start line: 0
Start column: 0
Host file:
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.Manifest.AssemblyManifest.LoadCMSFromStream(Stream stream)
at System.Deployment.Application.Manifest.AssemblyManifest..ctor(FileStream fileStream)
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
--- Inner Exception ---
System.Runtime.InteropServices.COMException
- Exception from HRESULT: 0x80070C81
- Source: System.Deployment
- Stack trace:
at System.Deployment.Internal.Isolation.IsolationInterop.CreateCMSFromXml(Byte[] buffer, UInt32 bufferSize, IManifestParseErrorCallback Callback, Guid& riid)
at System.Deployment.Application.Manifest.AssemblyManifest.LoadCMSFromStream(Stream stream)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
I'm a bit confused, what do you mean by:
"I am actually hosting the wcf service within the application so I don't really need MSBuild to do all this for me"
The WCF service should be a separate (server side only) solutions with all of the bits that belong server side only. The clickonce app should be a client side only solution, you reference the WCF service by creating web references, supplying a url etc for the service.
It is possible to have the WCF service (server side) in the same .sln as the winforms app, just make sure you do not add a project reference to the WCF service, the communication is done using web references only. Personally I think it's much cleaner to completely separate client and server side projects (having said that it does make sense in some instances to share some projects in both solutions, e.g. if you have a biz layer that is persistence layer ignorant then it could be shared).

Security exception on IIS 7.5 with no shared folder

I get an exception after upgrading Spring.NET 1.2 to 1.3 in my web application. Here's the setup on my web app:
I created an application pool with its identity set to ApplicationPoolIdentity. I use NHibernate 2.1, my SQL Server 2008 is local and I'm using SQL server authentication. There's no network or shared folder. Everything is local.
Now the weird thing is that if I change identity of my application pool in IIS to NetworkService, it starts working fine. I wonder what is the problem with setting the identity of my application pool to ApplicationPoolIdentity.
Here's the exception:
System.Configuration.ConfigurationErrorsException: Error creating context '/project1': That assembly does not allow partially trusted callers. ---> Spring.Objects.Factory.ObjectCreationException: Error thrown by a dependency of object 'MyObj' defined in 'file [D:\Projects\MyProject\Configs\Services.xml] line 37' : Initialization of object failed : Failed to create an instance of 'Spring.Data.NHibernate.Bytecode.ProxyFactoryFactory'!
while resolving 'Sleepers[0]' to 'CustomerManager' defined in 'file [D:\Projects\MyProject\Configs\Business.xml] line 64'
while resolving 'CustomerDAO' to 'CustomerDAO' defined in 'file [D:\Projects\MyProject\Configs\Dao.xml] line 50'
while resolving 'SessionFactory' to 'SessionFactory' defined in 'file [D:\Projects\MyProject\Configs\Dao.xml] line 21' ---> NHibernate.Bytecode.HibernateByteCodeException: Failed to create an instance of 'Spring.Data.NHibernate.Bytecode.ProxyFactoryFactory'! ---> System.Security.SecurityException: That assembly does not allow partially trusted callers.
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at NHibernate.Bytecode.ActivatorObjectsFactory.CreateInstance(Type type)
at NHibernate.Bytecode.AbstractBytecodeProvider.get_ProxyFactoryFactory()
The action that failed was:
LinkDemand
The assembly or AppDomain that failed was:
NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
The Zone of the assembly that failed was:
Internet
The Url of the assembly that failed was:
file:///D:/Projects/MyProject/bin/NHibernate.DLL
--- End of inner exception stack trace ---
IIS is trying to load and execute the assembly from the address: file:///D:/Projects/MyProject/bin/NHibernate.DLL.
Executing this will solve those permission issues within that machine:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -addgroup 1.2 -url
"file:///D:/Projects/MyProject/bin/*" FullTrust