У нас есть три среды (DEV, QA, PROD).
Каждая среда имеет два веб-сервера IIS.
Мы получили следующую ошибку времени выполнения только на 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
Мы смогли исправить эту ошибку времени выполнения PROD, установив для параметра «Включить 32-разрядные приложения» значение «Истина» для пула приложений.
Сейчас мы пытаемся выяснить, почему нам пришлось внести это изменение на обоих серверах PROD IIS, а не на серверах DEV или QA.
Я думаю, потому что в DEV и QA у вас, возможно, установлена Visual Studio, которая работает с ядрами 32/64 бит, поэтому все это автоматически настраивается для вас в IISExpress и в тестовой среде. В производстве это нужно делать вручную.