Array
(
)

Erro ao publicar aplicação no IIS 7

Randrade
   - 10 dez 2014

Galera, estou com o problema aqui, e estou sem saber o que fazer.
Estou publicando uma aplicação no IIS 7 e recebo o seguinte erro :
#Código

Could not load type 'System.Reflection.AssemblyMetadataAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Em minha máquina pessoal e no Visual Studio funciona perfeitamente a aplicação, quando tento iniciar no IIS, ela da esse erro.
Segue o Stack Trace:
#Código
[TypeLoadException: Could not load type 'System.Reflection.AssemblyMetadataAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]
   System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) +0
   System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +525
   System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +19
   System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +315
   System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) +208
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +1171
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +146
   WebActivator.AssemblyExtensions.GetActivationAttributes(Assembly assembly) +114
   WebActivator.ActivationManager.RunActivationMethods() +286
   WebActivator.ActivationManager.RunPreStartMethods() +38
   WebActivator.ActivationManager.Run() +56

[InvalidOperationException: The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Could not load type 'System.Reflection.AssemblyMetadataAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'..]
   System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +755
   System.Web.Compilation.BuildManager.CallPreStartInitMethods() +447
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1021

[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Could not load type 'System.Reflection.AssemblyMetadataAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'..]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +646
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +771

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 

Randrade
   - 10 dez 2014

Levantei um servidor de testes( Windows Server 2008 R2, .Net 4.0, IIS 7), configurações idênticas ao que de erro, porém no de testes, eu consegui levantar a aplicação sem problemas. Isso exclui erros na aplicação.

Porém necessito levantar no servidor original. Alguém teria alguma ideia?

Fabrica Software
|
MVP
    10 dez 2014

Brother da uma olhada nisso.

http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-web-deploy

ele verifica todas as configurações necessárias para o IIS deve estar faltando alguma coisa.

IIS7.26ASPNET.26NETFramework4.26WDeploy.exe