同一网站的三个环境中仅需启用其中一个环境的 32 位功能

同一网站的三个环境中仅需启用其中一个环境的 32 位功能

我们有三个环境(DEV,QA,PROD)。

每个环境都有两个 IIS Web 服务器。

我们仅在 PROD 上收到以下运行时错误:

‘/’应用程序中的服务器错误。

Unable to determine granted permission for assembly. 
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. 

异常详细信息:

System.IO.IsolatedStorage.IsolatedStorageException: Unable to determine granted permission for assembly.

源错误:

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. 

堆栈跟踪:

[IsolatedStorageException: Unable to determine granted permission for assembly.]
  System.IO.IsolatedStorage.IsolatedStorage.InitStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType) +510
   System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType) +77
   System.Lazy`1.CreateValue() +740
   System.Lazy`1.LazyInitValue() +372
   Cassette.Aspnet.ForAssembly.get_IsolatedStorageFile() +25
   Cassette.IO.IsolatedStorageFile.get_Storage() +15
   Cassette.IO.IsolatedStorageFile.get_Exists() +16
   Cassette.Aspnet.WebHostSettingsConfiguration.IsStaticCacheManifest(CassetteSettings settings) +86
   Cassette.Aspnet.WebHostSettingsConfiguration.Configure(CassetteSettings settings) +275
   Cassette.ConfigurationEnumerableExtensions.Configure(IEnumerable`1 configurations, T configurable) +176

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +394
   System.Reflection.ConstructorInfo.Invoke(Object[] parameters) +35
   Cassette.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +677

[TinyIoCResolutionException: Unable to resolve type: Cassette.CassetteSettings]
   Cassette.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +1044
   Cassette.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, ResolveOptions options) +63
   Cassette.TinyIoC.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) +145
   Cassette.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) +1349
   Cassette.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +552

[TinyIoCResolutionException: Unable to resolve type: Cassette.FileSystemWatchingBundleRebuilder]
   Cassette.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +852
   Cassette.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, ResolveOptions options) +63
   Cassette.TinyIoC.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) +145
   Cassette.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) +1349
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +265
   System.Linq.<CastIterator>d__b1`1.MoveNext() +296
   Cassette.HostBase.RunStartUpTasks() +234
   Cassette.HostBase.Initialize() +188
   Cassette.Aspnet.CassetteHttpModule.InitWithTraceLogging() +73
   Cassette.Aspnet.CassetteHttpModule.Init(HttpApplication httpApplication) +120
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +597
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +203
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +313
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +250

[HttpException (0x80004005): Unable to resolve type: Cassette.FileSystemWatchingBundleRebuilder]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +452
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +99
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +669

我们可以通过将应用程序池的“启用 32 位应用程序”设置为“True”来修复 PROD 运行时错误。

在此处输入图片描述

我们现在试图弄清楚的是,为什么我们必须在 PROD IIS 服务器上而不是 DEV 或 QA 服务器上进行这样的更改。

答案1

我认为是因为在 DEV 和 QA 中,您可能安装了适用于 32/64 位内核的 Visual Studio,因此 IISExpress 和测试环境中会自动为您配置所有配置。在生产中,您必须手动完成此操作。

相关内容