2012-04-20 6 views
5

नहीं जोड़ा जा सकता है मैंने एमवीसी 4 में एक नया वेब एप्लिकेशन बनाकर, और सभी फाइलों को कॉपी करने के बाद हाल ही में एमवीसी 3 से 4 तक अपने वेब ऐप को अपग्रेड किया, और अंततः विलय web.config। सभी मौजूदा वेब ऐप के साथ अच्छी तरह से काम करते हैं, हालांकि मैंने आज एक बहुत ही अजीब त्रुटि देखी है - अगर मैं डिफ़ॉल्ट डमी कार्यान्वयन के साथ एक नया एपीआई नियंत्रक बनाने की कोशिश करता हूं, और फिर उस एपीआई (उदाहरण/एपीआई/घटनाओं) पर ब्राउज़ करें, मुझे Could not load type त्रुटि मिलती है। अजीब बात यह है कि अगर मैं एप्लिकेशन के पुनर्निर्माण, और यूआरएल फिर से मारा है, यह एक अलग विधानसभा इसके बारे में शिकायत कर रहा है हो रहा है मुख्य रूप से यह इन 2 के बीच alternates:मैन्युअल रूप से एक एमवीसी वेब ऐप को 3 से 4 तक अपग्रेड किया गया है, एपीआई कंट्रोलर

Could not load type 'System.Web.Razor.Parser.SyntaxTree.CodeSpan' from assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. 

और

Could not load file or assembly 'Microsoft.Scripting, Version=1.1.0.20, Culture=neutral, PublicKeyToken=7f709c5b713576e1' or one of its dependencies. The system cannot find the file specified. 

मेरे web.config निम्नलिखित विधानसभा बंधन में जानकारी शामिल है:

<runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /> 
     <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> 
     <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /> 
     <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <!--<assemblyIdentity name="FluentValidation" publicKeyToken="a82054b837897c66" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-3.2.0.0" newVersion="3.2.0.0" />--> 
     <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" /> 
     <bindingRedirect oldVersion="0.0.0.0-4.0.8.0" newVersion="4.0.8.0" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 

और मेरे packages.config लगता है कि यह उस में सब ठीक बिट्स है:

<package id="AspNetMvc" version="4.0.20126.16343" /> 
    <package id="AspNetRazor.Core" version="2.0.20126.16343" /> 
    <package id="AspNetWebApi" version="4.0.20126.16343" /> 
    <package id="AspNetWebApi.Core" version="4.0.20126.16343" /> 
    <package id="AspNetWebPages.Core" version="2.0.20126.16343" /> 
    <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" /> 
    <package id="Microsoft.Web.Optimization" version="1.0.0-beta" /> 
    <package id="System.Net.Http" version="2.0.20126.16343" /> 
    <package id="System.Net.Http.Formatting" version="4.0.20126.16343" /> 
    <package id="System.Web.Http.Common" version="4.0.20126.16343" /> 
    <package id="System.Web.Providers" version="1.1" /> 
    <package id="System.Web.Providers.Core" version="1.0" /> 

मैं भी एक नया mvc4 वेब अनुप्रयोग है, जो अब भी मुझे एक ही त्रुटि (फ़ाइल या विधानसभा Microsoft.Scripting लोड नहीं कर सका)

देता से एक "वैनिला" एक के साथ अपने web.config से अधिक नकल की कोशिश की है
+0

, आप एक विधानसभा Microsoft.Scripting नामित है तुम नहीं? और क्या आपके पास नेमस्पेस System.Web.Razor.Parser.SyntaxTree में कोडस्पेन क्लास है? –

उत्तर

7

अपने web.config से इन पंक्तियों को हटाने का प्रयास

<dependentAssembly> 
    <assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" /> 
    <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> 
</dependentAssembly> 
संबंधित मुद्दे