मैं कैसिनी/वेबसेवर का उपयोग कर रहा हूं। वेबडेव एनयूनीट का उपयोग करके वेब सेवा के कुछ स्वचालित परीक्षण चलाने के लिए।कैसिनी/वेबसेवर। वेबडेव, एनयूनीट और ऐपडोमेन अनलोडेड एक्सेप्शन
मैं कुछ भी कल्पना नहीं कर रहा हूँ, बस
public class WebService{
Microsoft.VisualStudio.WebHost.Server _server;
public void Start(){
_server = new Microsoft.VisualStudio.WebHost.Server(_port, "/", _physicalPath);
}
public void Dispose()
{
if (_server != null)
{
_server.Stop();
_server = null;
}
}
}
[TestFixture]
public void TestFixture{
[Test]
public void Test(){
using(WebService webService = new WebService()){
webService.Start();
// actual test invoking the webservice
}
}
}
, लेकिन जब मैं यह nunit-console.exe का उपयोग कर चलाने के लिए, मैं निम्नलिखित उत्पादन प्राप्त करें:
NUnit version 2.5.0.9015 (Beta-2)
Copyright (C) 2002-2008 Charlie Poole.\r\nCopyright (C) 2002-2004 James W. Newki
rk, Michael C. Two, Alexei A. Vorontsov.\r\nCopyright (C) 2000-2002 Philip Craig
.\r\nAll Rights Reserved.
Runtime Environment -
OS Version: Microsoft Windows NT 6.0.6001 Service Pack 1
CLR Version: 2.0.50727.1434 (Net 2.0.50727.1434)
ProcessModel: Default DomainUsage: Default
Execution Runtime: net-2.0.50727.1434
.....
Tests run: 5, Errors: 0, Failures: 0, Inconclusive: 0 Time: 28,4538451 seconds
Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
Unhandled exceptions:
1) TestCase1 : System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
2) TestCase2 : System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
3) TestCase3 : System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
4) TestCase4 : System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
अगर मैं चलाने nunit- डीबगर के तहत कंसोल, मुझे डीबग कंसोल में निम्न आउटपुट मिलता है:
[...]
The thread 0x1974 has exited with code 0 (0x0).
############################################################################
############## S U C C E S S #################
############################################################################
Executed tests : 5
Ignored tests : 0
Failed tests : 0
Unhandled exceptions : 4
Total time : 25,7092944 seconds
############################################################################
The thread 0x1bd4 has exited with code 0 (0x0).
The thread 0x10f8 has exited with code 0 (0x0).
The thread '<No Name>' (0x1a80) has exited with code 0 (0x0).
A first chance exception of type 'System.AppDomainUnloadedException' occurred in System.Web.dll
##### Unhandled Exception while running
System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
at System.Web.Hosting.ApplicationManager.HostingEnvironmentShutdownComplete(String appId, IApplicationHost appHost)
at System.Web.Hosting.HostingEnvironment.OnAppDomainUnload(Object unusedObject, EventArgs unusedEventArgs)
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in System.Web.dll
The thread 0x111c has exited with code 0 (0x0).
The program '[0x1A64] nunit-console.exe: Managed' has exited with code -100 (0xffffff9c).
क्या किसी के पास कोई विचार है जो बी ई यह कारण है?
क्या आपको कभी इस समस्या का समाधान मिला है? मुझे एक समान समस्या है। –
कोई/अच्छा/समाधान नहीं है, लेकिन मैंने एनएनआईटी-टास्क पर असफलता = "झूठी" सेटिंग को समाप्त कर दिया है और एक अलग टूल्स के साथ एक्सएमएल-आउटपुट पोस्टप्रोसेसिंग किया है, जो अनचाहे AppDomainUnloadedException को अनदेखा करता है। –
मैंने https://bugs.launchpad.net/nunitv2/+bug/423611 पर उचित NUnit बग में समस्या का प्रदर्शन करने वाला एक उदाहरण समाधान अपलोड किया है। यह बहुत अच्छा होगा अगर आप इसे आज़मा सकते हैं और इसकी वैधता को पार कर सकते हैं (और लॉन्चपैड पर अपने निष्कर्ष पोस्ट कर सकते हैं) –