SarcasticBaldGuy
unread,Nov 9, 2009, 11:07:51 PM11/9/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Castle Project Users
Wanted to post this in case it can help others later.
I downloaded Castle ActiveRecord 2.0 last night and proceeded to
update an application using an earlier version. When I attempted to
load the configuration from the web.config, I received the security
exception listed below.
Google led me to believe it was a "Medium Trust" issue which didn't
really help since I'm running locally.
After beating my head against the desk, I started to copy the files to
a USB drive to try on another computer and windows alerted me that the
files contained additional information that would be removed.
Sure enough, checking the properties of the Castle files resulted in
the "this file came from another computer and might be blocked to help
protect this computer" message being displayed and the "Unblock"
button being visible.
Once I "unblocked" all of the files (all at once using Streams v1.56),
everything worked just as it should.
I didn't see this particular situation or solution mentioned anywhere
on the internet. Hopefully it will help someone in the future.
Here is the exception I received:
[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
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)
[ConfigurationErrorsException]: An error occurred creating the
configuration section handler for activerecord: That assembly does not
allow partially trusted callers. (C:\Projects\FIS.TPPAFramework.WebUI
\FIS.TPPAFramework.WebUI\web.config line 24)
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.Web.HttpContext.GetSection(String sectionName)
at
System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection
(String configKey)
at System.Configuration.ConfigurationManager.GetSection(String
sectionName)
at
Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler.get_Instance
() in c:\daten\dev\External\Castle\AR2.0\ActiveRecord
\Castle.ActiveRecord\Framework\Config
\ActiveRecordSectionHandler.cs:line 51
at FIS.TPPAFramework.WebUI.MvcApplication.RegisterEntities() in C:
\Projects\FIS.TPPAFramework.WebUI\FIS.TPPAFramework.WebUI
\Global.asax.cs:line 43
at FIS.TPPAFramework.WebUI.MvcApplication.Application_Start() in C:
\Projects\FIS.TPPAFramework.WebUI\FIS.TPPAFramework.WebUI
\Global.asax.cs:line 36
[HttpException]: An error occurred creating the configuration section
handler for activerecord: That assembly does not allow partially
trusted callers. (C:\Projects\FIS.TPPAFramework.WebUI
\FIS.TPPAFramework.WebUI\web.config line 24)
at
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode
(HttpContext context, HttpApplication app)
at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS
(IntPtr appContext, HttpContext context, MethodInfo[] handlers)
at System.Web.HttpApplication.InitSpecial(HttpApplicationState
state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance
(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr
appContext)
[HttpException]: An error occurred creating the configuration section
handler for activerecord: That assembly does not allow partially
trusted callers. (C:\Projects\FIS.TPPAFramework.WebUI
\FIS.TPPAFramework.WebUI\web.config line 24)
at System.Web.HttpRuntime.FirstRequestInit(HttpContext context)
at System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext
context)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate
(IIS7WorkerRequest wr, HttpContext context)