2012-10-30 10 views
9

, वीएस में डीबग शुरू करते समय त्रुटि उठाई जाएगी।"फ़ाइल या असेंबली या इसकी निर्भरताओं में से कोई लोड नहीं हो सका। एक प्रोग्राम को गलत स्वरूप के साथ लोड करने का प्रयास किया गया था।" वीएस में डीबग करते समय

त्रुटि के नीचे है:

Could not load file or assembly 'p4dn, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' 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 'p4dn, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' 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. 

Stack Trace: 


[BadImageFormatException: Could not load file or assembly 'p4dn, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.] 
    System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0 
    System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43 
    System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127 
    System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142 
    System.Reflection.Assembly.Load(String assemblyString) +28 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46 

[ConfigurationErrorsException: Could not load file or assembly 'p4dn, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' 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) +613 
    System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203 
    System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105 
    System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178 
    System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54 
    System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +232 
    System.Web.Compilation.BuildManager.CompileGlobalAsax() +51 
    System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +337 

[HttpException (0x80004005): Could not load file or assembly 'p4dn, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.] 
    System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58 
    System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512 
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729 

[HttpException (0x80004005): Could not load file or assembly 'p4dn, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.] 
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8921851 
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85 
    System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259 

जब मैं जो का उपयोग 'p4dn.dll' वहाँ भर में आने वाले इस त्रुटि नहीं है एक सी # परियोजना बनाने।

यह मेरा पहला एएसपी प्रोजेक्ट है, मैंने "http://stackoverflow.com/questions/41449/i-get-a-an-attempt-was-made-to-load-a जैसे समान प्रश्न भी पढ़े -प्रोग्राम-साथ-गलत-प्रारूप-त्रुटि-ओ "और" http://stackoverflow.com/questions/1648213/could-not-load-file-or-assembly-xxx-or-one-of-its "-dependencies-एक-प्रयास-था। वे मेरी समस्या का समाधान नहीं कर सकते हैं।

मैं इस समस्या को कैसे हल कर सकता हूं?

+0

जांच करें कि बटन पर क्लिक करें प्रोजेक्ट के फ़ोल्डर में डीएलएल की गुण केवल पढ़ने या नहीं है। अगर केवल पढ़ा जाता है, तो इसे अनचेक करें। –

+0

मैंने इसे चेक किया है और यह लिखने योग्य है। –

उत्तर

5

मेरे पास आईआईएस एक्सप्रेस 8.0 का उपयोग कर 64-बिट एमवीसी साइट चलाने (डीबग) चलाने का प्रयास करने वाला एक ही त्रुटि संदेश था। मैंने सत्यापित किया कि मेरी सभी परियोजनाएं x64 प्लेटफ़ॉर्म को लक्षित कर रही हैं।

समस्या उत्पन्न हो रही थी क्योंकि विजुअल स्टूडियो आईआईएस एक्सप्रेस के 32-बिट संस्करण को चलाता है। काम करने के लिए एकमात्र तरीका यह है कि मैन्युअल रूप से निम्न आदेश निष्पादित करके 64-बिट आईआईएस एक्सप्रेस चलाने के लिए।

"C:\Program Files\IIS Express\iisexpress.exe" /config:"U:\IISExpress\config\applicationhost.config" /site:"Imaging.Web" /apppool:"Clr4IntegratedAppPool" 

फिर अपने दृश्य स्टूडियो वेब परियोजना में, गुण के लिए जाना "का प्रयोग करें कस्टम वेब सर्वर" का चयन करें, और आपकी साइट के लिए URL दर्ज करें।

डीबग के लिए, डीबग> प्रक्रिया से संलग्न करें .. और फिर अपने चल रहे आईआईएस एक्सप्रेस इंस्टेंस का चयन करें।

विजुअल स्टूडियो टीम को वास्तव में परियोजना गुणों में यह एक विकल्प बनाना चाहिए।

1

एक नया आईआईएस पूल अपनी वेब साइट के लिए सक्षम करें 32 बिट इस पूल के लिए संबंधित ==> साइट आवेदन पूल करने के लिए, बनाने के सभी

9

जाओ == पर

क्लिक करें> एडवांस सेटिंग

 Change value of ==> "Enable 32-Bit Applications" from False to True 
+0

जब मैं इस मुद्दे को दबाता हूं तो यह हमेशा मेरे लिए सही जवाब रहा है। –

+0

हां, मुझे बस यह समस्या फिर से मिली, एक बार फिर इसे हल किया गया, उसी पोस्ट पर वापस आया और फिर इसे फिर से ऊपर उठाने की कोशिश की, और फिर मेरी पुरानी टिप्पणी, आह यादें देखी गईं :)। –

+0

:) हाँ यह सही है, यह बहुत कुछ होता है, हम फिर से एक ही मुद्दे पर आते हैं और हम चारों ओर खोज करते हैं और इसके पास आते हैं। और कहो हाँ .. या मुझे याद है। !! :) –

14

आईआईएस एक्सप्रेस के 64 बिट संस्करण को चलाने के लिए अब मेनू विकल्प है। दृश्य स्टूडियो मेनू टूल से -> विकल्प ... -> परियोजनाओं और समाधान -> वेब प्रोजेक्ट

"वेब साइटों और परियोजनाओं के लिए आईआईएस एक्सप्रेस के 64 बिट संस्करण का उपयोग करें" के लिए

+1

यह खोजना इतना कठिन क्यों है ?! निश्चित रूप से यदि आप 64 बिट वीएस स्टूडियो चुनते हैं तो इसे समझने के लिए पर्याप्त स्मार्ट होना चाहिए! – SlimCheney

+0

वह स्मार्ट नहीं है, यह निश्चित रूप से परेशान है! –

+0

धन्यवाद यह मेरे लिए काम किया। –

संबंधित मुद्दे

 संबंधित मुद्दे