2016-02-04 6 views
0

пытается работать с приложением mvc 3, используя визуальную студию 2010. Приложение отлично компилируется. Однако, во время выполнения.Не удалось загрузить файл или сборку - приложение asp.net mvc

Could not load file or assembly 'InnVue.BOA.RoomControl' or one of its dependencies. An attempt was made to load a program with an incorrect format. 

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.BadImageFormatException: Could not load file or assembly 'InnVue.BOA.RoomControl' or one of its dependencies. An attempt was made to load a program with an incorrect format. 

Source Error: 

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. 

нагрузки Ассамблеи Трассировка: Следующая информация может быть полезной, чтобы определить причину сборки «InnVue.BOA.RoomControl» не может быть загружен.

=== Pre-bind state information === 
LOG: DisplayName = InnVue.BOA.RoomControl 
(Partial) 
WRN: Partial binding information was supplied for an assembly: 
WRN: Assembly Name: InnVue.BOA.RoomControl | Domain ID: 10 
WRN: A partial bind occurs when only part of the assembly display name is provided. 
WRN: This might result in the binder loading an incorrect assembly. 
WRN: It is recommended to provide a fully specified textual identity for the assembly, 
WRN: that consists of the simple name, version, culture, and public key token. 
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. 
LOG: Appbase = file:///C:/Users/KHAN/Documents/GitHub/innvue/InnVue.InnDesk/InnVue.InnDesk/InnVue.InnDesk/ 
LOG: Initial PrivatePath = C:\Users\KHAN\Documents\GitHub\innvue\InnVue.InnDesk\InnVue.InnDesk\InnVue.InnDesk\bin 
Calling assembly : (Unknown). 
=== 
LOG: This bind starts in default load context. 
LOG: Using application configuration file: C:\Users\KHAN\Documents\GitHub\innvue\InnVue.InnDesk\InnVue.InnDesk\InnVue.InnDesk\web.config 
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. 
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). 
LOG: Attempting download of new URL file:///C:/Users/KHAN/AppData/Local/Temp/Temporary ASP.NET Files/root/41f4bb6c/382c05ac/InnVue.BOA.RoomControl.DLL. 
LOG: Attempting download of new URL file:///C:/Users/KHAN/AppData/Local/Temp/Temporary ASP.NET Files/root/41f4bb6c/382c05ac/InnVue.BOA.RoomControl/InnVue.BOA.RoomControl.DLL. 
LOG: Attempting download of new URL file:///C:/Users/KHAN/Documents/GitHub/innvue/InnVue.InnDesk/InnVue.InnDesk/InnVue.InnDesk/bin/InnVue.BOA.RoomControl.DLL. 
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated. 

И стек трассировки:

[BadImageFormatException: Could not load file or assembly 'InnVue.BOA.RoomControl' or one of its dependencies. An attempt was made to load a program with an incorrect format.] 
    System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 
    System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36 
    System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152 
    System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77 
    System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21 
    System.Reflection.Assembly.Load(String assemblyString) +28 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38 

[ConfigurationErrorsException: Could not load file or assembly 'InnVue.BOA.RoomControl' or one of its dependencies. An attempt was made to load a program with an incorrect format.] 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +738 
    System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217 
    System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130 
    System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170 
    System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92 
    System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +290 
    System.Web.Compilation.BuildManager.ExecutePreAppStart() +157 
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +531 

[HttpException (0x80004005): Could not load file or assembly 'InnVue.BOA.RoomControl' or one of its dependencies. An attempt was made to load a program with an incorrect format.] 
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9942412 
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90 
    System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +456 

Я подтвердил:

InnVue.BOA.RoomControl.dll действительно 64-битную DLL

сборки, на которые ссылается InnVue.BOA. RoomControl.dll также ссылается на основной проект.

Есть ли способ отслеживать, где именно это ломается? информация, предоставленная в трассировке стека, не очень очевидна.

ответ

0

Простой тест для проверки ссылок на сборки, если он был добавлен правильно в ваш проект с помощью , копия локальная. Попробуйте развернуть релиз Создайте свой локальный IIS и попробуйте запустить проект. вероятно, ваше приложение не будет запущено из-за отсутствия сборок, продолжите его исправление перед возвратом и упакуйте свое веб-приложение, чтобы проверить его на Azure.

Кроме того, я использую Просмотрщик привязки к журналу привязки, это точно сообщит вам, что такое недостающая сборка, которая не существует в GAC или в каталоге bin.

Ссылка для скачивания: https://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx

Надеется, что это помогает!

+0

спасибо за предложение, проверяя его –

+0

интересно, проект отлично работает в локальном IIS, но отладка все еще не работает. Означает ли это какие-либо подсказки? –

+0

удалите развертывание IIS, включая каталог bin, нажмите новую сборку DEBUG, присоедините процесс w3wp и запустите приложение. Вы сможете отлаживать приложение. вы должны убедиться, что вы приложите правильный процесс, это ключ. иначе вы не сможете отлаживать IIS. – Mostafa

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