English 中文(简体)
为/用Nunit“不是N单位测试”建造的测试 dll(包括回答)
原标题:Test dll built for/with NUnit "is not a NUnit Test" (answer included)

有< a href=> https://stackoverflow.com/ questions/4372981/nunit-error- not-a-est-a-assembly> 有关SO 的另一个问题, 是关于将这个输入输出窗口的问题。 他们的答案包含 GAC 和 dll 版本。 我的答复是针对我的情况的, 即使它表现出同样的症状 。

输出窗口 - 测试

 E:CodeRepository-GitDFBAzureAzureMgmtServiceDashboardWp7AzureMgmt.DashboardFeeds.TestinDebugWp7AzureMgmt.DashboardFeeds.Test.dll  is not a NUnit Test

我的问题是 App. config 对一个众所周知的密钥有错误的值。 我已经在 MVC Web. config 中纠正了这一点, 但忘了在测试中修正它. dll 。

当我试图从NUF gui(工程确实装货)中调出数据时, Gui投出一个未处理的例外。 细节如下:

 See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: The configSource attribute must be a relative physical path, so the  /  character is not allowed. (E:CodeRepository-GitDFBAzureAzureMgmtServiceDashboardWp7AzureMgmt.DashboardFeeds.TestinDebugWp7AzureMgmt.DashboardFeeds.Test.dll.config line 12)
   at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
   at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
   at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
   --- End of inner exception stack trace ---

Server stack trace: 
   at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
   at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
   at System.Configuration.ConfigurationManager.GetSection(String sectionName)
   at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
   at System.Net.Configuration.SettingsSectionInternal.get_Section()
   at System.Net.Sockets.Socket.InitializeSockets()
   at System.Net.IPAddress.InternalParse(String ipString, Boolean tryParse)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink..ctor(String channelURI, TcpClientChannel channel)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSinkProvider.CreateSink(IChannelSender channel, String url, Object remoteChannelData)
   at System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider.CreateSink(IChannelSender channel, String url, Object remoteChannelData)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientChannel.CreateMessageSink(String url, Object remoteChannelData, String& objectURI)
   at System.Runtime.Remoting.RemotingConfigHandler.FindDelayLoadChannelForCreateMessageSink(String url, Object data, String& objectURI)
   at System.Runtime.Remoting.RemotingServices.CreateEnvoyAndChannelSinks(MarshalByRefObject tpOrObject, ObjRef objectRef, IMessageSink& chnlSink, IMessageSink& envoySink)
   at System.Runtime.Remoting.RemotingServices.InternalUnmarshal(ObjRef objectRef, Object proxy, Boolean fRefine)
   at System.Runtime.Remoting.ObjRef.GetRealObjectHelper()
   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.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
   at System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.FixupForNewAppDomain()
   at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
   at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)

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.BeginRun(EventListener listener, ITestFilter filter, Boolean captureTrace, LoggingThreshold logLevel)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [1]: 
   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.BeginRun(EventListener listener, ITestFilter filter, Boolean captureTrace, LoggingThreshold logLevel)
   at NUnit.Core.ProxyTestRunner.BeginRun(EventListener listener, ITestFilter filter, Boolean tracing, LoggingThreshold logLevel)
   at NUnit.Util.TestLoader.RunTests(ITestFilter filter)
   at NUnit.UiKit.TestSuiteTreeView.RunTests(ITest[] tests, Boolean ignoreCategories)
   at NUnit.Gui.NUnitForm.runButton_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
nunit
    Assembly Version: 2.6.0.12051
    Win32 Version: 2.6.0.12051
    CodeBase: file:///C:/Program%20Files%20(x86)/NUnit%202.6/bin/nunit.exe
----------------------------------------
nunit-gui-runner
    Assembly Version: 2.6.0.12051
    Win32 Version: 2.6.0.12051
    CodeBase: file:///C:/Program%20Files%20(x86)/NUnit%202.6/bin/lib/nunit-gui-runner.DLL
----------------------------------------
nunit.core
    Assembly Version: 2.6.0.12051
    Win32 Version: 2.6.0.12051
    CodeBase: file:///C:/Program%20Files%20(x86)/NUnit%202.6/bin/lib/nunit.core.DLL
----------------------------------------
nunit.util
    Assembly Version: 2.6.0.12051
    Win32 Version: 2.6.0.12051
    CodeBase: file:///C:/Program%20Files%20(x86)/NUnit%202.6/bin/lib/nunit.util.DLL
----------------------------------------
nunit.core.interfaces
    Assembly Version: 2.6.0.12051
    Win32 Version: 2.6.0.12051
    CodeBase: file:///C:/Program%20Files%20(x86)/NUnit%202.6/bin/lib/nunit.core.interfaces.DLL
----------------------------------------
nunit.uikit
    Assembly Version: 2.6.0.12051
    Win32 Version: 2.6.0.12051
    CodeBase: file:///C:/Program%20Files%20(x86)/NUnit%202.6/bin/lib/nunit.uikit.DLL
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5458 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
nunit.uiexception
    Assembly Version: 2.6.0.12051
    Win32 Version: 2.6.0.12051
    CodeBase: file:///C:/Program%20Files%20(x86)/NUnit%202.6/bin/lib/nunit.uiexception.DLL
----------------------------------------
System.Web
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_64/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
vg5zflea
    Assembly Version: 2.6.0.12051
    Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
问题回答

以下是我的答案:

重要的一点是:

The configSource attribute must be a relative physical path, so the  /  character is not allowed.

当我终于停止看NUM版本和GAC时, 用简单的方法解决了我的问题。





相关问题
Selenium not working with Firefox 3.x on linux

I am using selenium-server , selenium rc for UI testing in my application . My dev box is Windows with FireFox 3.5 and every thing is running fine and cool. But when i try to run selenium tests on my ...

Best browser for testing under Safari Mobile on Linux?

I have an iPhone web app I m producing on a Linux machine. What s the best browser I can use to most closely mimic the feature-limited version of Safari present on the iPhone? (It s a "slimmed down" ...

Code Coverage Tools & Visual Studio 2008 Pro

Just wondering what people are using for code coverage tools when using MS Visual Studio 2008 Pro. We are using the built-in MS test project and unit testing tool (the one that come pre-installed ...

Is there any error checking web app cralwers out there?

Wondering if there was some sort of crawler we could use to test and re-test everything when changes are made to the web app so we know some new change didn t error out any existing pages. Or maybe a ...

热门标签