2013-11-28 2 views
0

Я разместил приложение MVC в Window Azure как Cloud Service. Я использую службу отчетов RDLC для отчетности. Каждый первый раз с небольшими интервалами, когда я вызываю свой отчет RDLC, он заканчивается ошибкой сервера. Обновление поможет решить проблему, и отчет будет загружен просто отлично. Это проблема с окружающей средой? Кто-нибудь сталкивался с такими проблемами? Что может решить эта проблема? Сведения об ошибках приведены ниже:Ошибка Windows Azure и ошибка загрузки отчета RDLC

Server Error in '/' Application.

Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

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.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

  1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

or:

2) Add the following section to the configuration file of your application:

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace:

[TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' 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 System.Web.UI.AssemblyCache.GetAjaxFrameworkAssemblyAttribute(Assembly assembly) +103 System.Web.UI.ScriptManager.get_DefaultAjaxFrameworkAssembly() +592 System.Web.UI.ScriptManager..ctor() +30 ASP.rdlcs_viewreport_aspx.__BuildControlform1() +202 ASP.rdlcs_viewreport_aspx.FrameworkInitialize() +193 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +72 System.Web.UI.Page.ProcessRequest() +269 System.Web.UI.Page.ProcessRequest(HttpContext context) +167 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +664 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270

+0

Я сделал это в лазури. Во-первых, важно знать, что в бесплатном использовании вы не можете использовать 64-битный скомпилированный веб-сайт, поэтому проверьте, не является ли ваша конфигурация сборки в X86 или X64. Также вам необходимо отметить ссылки «Microsoft.ReportViewer.Common», «Microsoft.ReportViewer.ProcessingObjectModel», «Microsoft.ReportViewer.WebForms» как «Копировать локальную», установленную в «true». Я должен сделать это с другими ссылками в проекте, которые не «живут» в среде Azure. Надеюсь, поможет! –

+0

Все еще я сталкиваюсь с этой проблемой –

ответ

0

Настройка вы Azure Cloud Service, чтобы работать под управлением операционных систем, таких как "Windows Server 2012 или выше", который имеет .NET 4.5 во встроенной.

enter image description here

Смежные вопросы