2012-02-11 18 views
8

मैं कुछ स्वीकृति परीक्षण Watin का उपयोग कर चलाना चाहते हैं और मैं निम्नलिखित त्रुटि मिलती है जब मैं NUnit जीयूआई में परीक्षण विधानसभा को खोलने का प्रयास:NUnit FileNotFoundException: System.Configuration

System.IO.FileNotFoundException: नहीं किया जा सका लोड फ़ाइल या असेंबली 'सिस्टम। कॉन्फ़िगरेशन, संस्करण = 4.0.0.0, संस्कृति = तटस्थ, PublicKeyToken = b03f5f7f11d50a3a' या इसकी निर्भरताओं में से एक। सिस्टम निर्दिष्ट फ़ाइल नहीं ढूंढ सकता है।

अपवाद विवरण:

System.IO.FileNotFoundException... 

Server stack trace: 
    at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) 
    at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) 
    at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) 
    at System.Reflection.Assembly.Load(String assemblyString) 
    at System.UnitySerializationHolder.GetRealObject(StreamingContext context) 
    at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder) 
    at System.Runtime.Serialization.ObjectManager.DoFixups() 
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) 
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) 
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage) 
    at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg) 

Exception rethrown at [0]: 
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
    at NUnit.Core.TestRunner.Load(TestPackage package) 
    at NUnit.Core.ProxyTestRunner.Load(TestPackage package) 
    at NUnit.Util.ProcessRunner.Load(TestPackage package) 
    at NUnit.Util.TestLoader.LoadTest(String testName) 

सब कुछ इससे पहले कि मैं आदेश App.config से आधार यूआरएल को पढ़ने के लिए में System.Configuration के लिए एक संदर्भ जोड़ा ठीक काम किया

उत्तर

14

ऐसा प्रतीत होता है समस्या यह है कि App.config फ़ाइल में अनुभागों का क्रम था।

मैंने पहले सबसे पहले appSettings अनुभाग जोड़ा, लेकिन जब मैंने इसे स्थानांतरित कर दिया तो सबकुछ काम करना शुरू कर दिया क्योंकि इसे फिर से करना चाहिए।

यहाँ App.config सामग्री है:

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <configSections> 
     <sectionGroup name="NUnit"> 
      <section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/> 
     </sectionGroup> 
    </configSections> 

    <NUnit> 
     <TestRunner> 
      <add key="ApartmentState" value="STA"/> 
     </TestRunner> 
    </NUnit> 

    <appSettings> 
     <add key="BaseUrl" value="http://localhost/Test"/> 
    </appSettings> 
</configuration> 
+1

* आह * धन्यवाद .. –

+3

मैं यह काम करने देने के लिए निम्न के प्रकार बदलने के लिए की जरूरत: type = "System.Configuration.NameValueSectionHandler, सिस्टम, संस्करण = 4.0.0.0, संस्कृति = तटस्थ, PublicKeyToken = b77a5c561934e089 " – rfcdejong