2012-09-28 7 views
16

मैं एक वेब एप्लिकेशन पर काम कर रहा हूं जो टीएफएस के साथ बातचीत करता है। जब मैं अपने एप्लिकेशन को विंडोज़ एज़ूर क्लाउड पर अपलोड करता हूं तो मुझे यह त्रुटि संदेश मिल रहा है।फ़ाइल या असेंबली 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache' या इसकी निर्भरताओं में से कोई भी लोड नहीं हो सका

इस समस्या को हल करने के लिए अपने इनपुट की सराहना करते हैं।

नीचे चिपकाया मैं

Server Error in '/' Application. 
-------------------------------------------------------------------------------- 


Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache' 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 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache' 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. 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache' could not be loaded. 



WRN: Assembly binding logging is turned OFF. 
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. 
Note: There is some performance penalty associated with assembly bind failure logging. 
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. 



Stack Trace: 



[BadImageFormatException: Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache' 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, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 
    System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +567 
    System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +192 
    System.Reflection.Assembly.Load(String assemblyString) +35 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +123 

[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache' 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) +11568240 
    System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +485 
    System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +79 
    System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +337 
    System.Web.Compilation.BuildManager.CallPreStartInitMethods() +280 
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1167 

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.Cache' or one of its dependencies. An attempt was made to load a program with an incorrect format.] 
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11700976 
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141 
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4869205 




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

उत्तर

17

यह (नीला) है, क्योंकि अपनी परियोजना एक 64-बिट वातावरण में एक 32-बिट dll उपयोग करने के लिए कोशिश कर रहा है

मुद्दों के इस प्रकार का समाधान करने के लिए, नीचे दिए गए आदेशों किसी पाठ फ़ाइल में स्टार्टअप स्क्रिप्ट नीचे

कॉपी के साथ एक स्क्रिप्ट शुरू बना सकते हैं और के रूप में "setup.cmd" सेव करें। फिर अपने वेब भूमिका परियोजना में इस फाइल, सेट "प्रतिलिपि स्थानीय" शामिल = सच तो webrole टैग के अंदर दी स्टार्टअप आदेश नीचे अपना ServiceDefinition.csdef खोलने

<webrole > --your webrole 
    <Startup> 
       <Task commandLine="setup.cmd" executionContext="elevated" /> 
      </Startup> 
</webrole > 

शुरू स्क्रिप्ट नीचे चिपकाया:

%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/applicationPools /applicationPoolDefaults.enable32BitAppOnWin64:"True" /commit:apphost 
+1

यहां पुष्टि करते हुए, स्क्रिप्ट चलाने से समस्या हल हो गई। ASP.NET ऐप के स्टार्टअप पर .cmd निष्पादित करने का कोई तरीका? – AlexVPerl

+9

एप्लिकेशन पूल में, "उन्नत सेटिंग्स" पर क्लिक करें, फिर "32-बिट एप्लिकेशन सक्षम करें" को सही पर सेट करें। एप्लिकेशन पूल को पुनरारंभ करें। – Jeppen

6

BadImageFormat अपवाद प्राप्त कर रहा त्रुटि संदेश लगभग हमेशा एक 32 बिट dll एक 64 बिट dll या एक DLL या निष्पादन योग्य अप लोड करने की कोशिश के बीच कोई समस्या एक 64 बिट के रूप में भरी हुई है है असेंबली, लेकिन इसमें 32-बिट फीचर्स या संसाधन शामिल हैं।

अपने आवेदन 86 या ठीक इसके विपरीत करने के लिए नीचे संकलन की कोशिश करो और मुझे पता है कैसे काम करता है कि जाने

+0

वास्तव में मैंने पहले से ही परियोजना गुणों के लिए मंच "कोई सीपीयू", मंच लक्ष्य "कोई सीपीयू" विकल्प चुना है। क्या आपका आशय यही था ? – Millar

+0

मैंने x86 पर प्लेटफ़ॉर्म लक्ष्य सेट करने का भी प्रयास किया, लेकिन फिर भी मुझे एक ही त्रुटि मिल रही है, एक बार जब मैं – Millar

+0

पर तैनात करता हूं तो यह मेरे लिए काम करता है। धन्यवाद – Jeppen

18

मैंने अपने एएसपीनेट वेब प्रोजेक्ट के बिन फ़ोल्डर से संबंधित डीएलएल को हटाकर इस मुद्दे को हल किया।

धन्यवाद और सादर,

+1

कृपया अपने उत्तर के साथ अधिक जानकारी प्राप्त करें। उदाहरण के लिए एक नमूना कोड। – Luv

+8

ऐसा लगता है कि यह उत्तर स्पष्ट हो सकता है - "बिन फ़ोल्डर से डीएलएल को हटाएं" - मेरे लिए काम किया, कोई नमूना कोड इत्यादि की आवश्यकता नहीं –

+3

यदि बीआईएन फ़ोल्डर में फ़ाइलें सर्वर पर स्थापित की गई चीज़ों के साथ संघर्ष करती हैं तो इससे समस्याएं हो सकती हैं । यदि TFS dlls पहले से ही सर्वर पर हैं तो डीएल को तैनात करने की आवश्यकता नहीं है। यह मेरे मामले में सच था और उन्हें मुद्दे से तय बिन से हटा दिया गया था। –

8

मैं अनुप्रयोग पूल जो साइट का इस्तेमाल किया Advanced Settings में True करने के लिए Enable 32-Bit applications विकल्प सेट करके ऐसा संकल्प लिया।

+0

धन्यवाद।मैंने कई समाधानों की कोशिश की लेकिन यह मेरे लिए काम किया। – SeeTheC