停止测试后停止 cassiniDev
我从 cmd
C:\CruiseControl.NET-1.5.0.6237\cassinidev.3.5.0.5.src-repack\CassiniDev\bin\Debug\CassiniDev.exe /a:D:_CCNET\proj /pm:Specific /p: 运行 cassiniDev 3811
然后开始调试和测试。完成测试后,如何从 CMD 停止 cassiniDev。我尝试使用 cassiniDev_console 但控制台不工作,所以我从控制台使用 cassiniDev。
i run cassiniDev from cmd
C:\CruiseControl.NET-1.5.0.6237\cassinidev.3.5.0.5.src-repack\CassiniDev\bin\Debug\CassiniDev.exe /a:D:_CCNET\proj /pm:Specific /p:3811
and then start debugging and testing. How can i stop cassiniDev from CMD after i finished testing. I try with cassiniDev_console but console not working so i am using cassiniDev from console.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,很高兴看到有人正在使用 CassiniDev,并回答您的问题:
您可以使用超时参数启动它: /t:[mstilkill]
这将告诉应用程序在没有请求的情况下在 20 秒后关闭。
关于控制台应用程序失败:重新打包应该已经解决了控制台构建的问题。您可以添加一个问题并描述问题吗?
其次,您可能会在控制台项目中注意到一种名为
Fixture
的类型,如果您遵循示例 NUnit 测试,则可以使用该类型在测试装置中托管服务器,并在测试完成时将其关闭。第三,创建 CassiniDev 是为了在环回以外的 IP 上启用易于使用的 ASP.Net 服务器。
您的命令行表明您不需要这样做,因此您可以使用更本机的方法获得更好的体验,例如简单地托管 WebDevHost。
我计划很快在 CassiniDev 页面上宣传这种替代可能性。看来我得快点了。 ;-)
试试这个:
示例测试装置
WebHostServer.cs
注意:
Microsoft.VisualStudio.WebHost 命名空间包含在文件 WebDev.WebHost 中.dll。该文件位于 GAC 中,但无法从 Visual Studio 中添加对此程序集的引用。
要添加引用,您需要在文本编辑器中打开 .csproj 文件并手动添加引用。
查找包含项目引用的 ItemGroup 并添加以下元素:
引用:来自 http://www.codeproject.com/KB/aspnet/test-with-vs-devserver-2.aspx
First, glad to see someone is getting use out of CassiniDev, and to answer your question:
You can start it with the timeout param: /t:[ms till kill]
This will tell the app to shutdown after 20 seconds without a request.
Regarding the console app failing: The repack should have solved the issues with the console build. Can you add an issue and describe the problem.
Secondly, you may notice in the console project a type called
Fixture
that, if you follow the example NUnit tests, can be used to capably host the server in a test fixture and shut it down when the test completes.Thirdly, CassiniDev was created to enable an easy to use ASP.Net server on an IP other than loopback.
Your command line indicates that you do not require this so you may have a better experience using a more native method, such as simply hosting the WebDevHost.
I plan to advertise this alternate possibility on the CassiniDev page soon. Looks like I should hurry up. ;-)
Try this:
Sample Test Fixture
WebHostServer.cs
NOTE:
The Microsoft.VisualStudio.WebHost namespace is contained in the file WebDev.WebHost.dll. This file is in the GAC but it is not possible to add a reference to this assembly from within Visual Studio.
To add a reference you will need to open your .csproj file in a text editor and add the reference manually.
Look for the ItemGroup that contains the project references and add the following element:
Reference: the second example from http://www.codeproject.com/KB/aspnet/test-with-vs-devserver-2.aspx
http://www.microsoft.com/whdc/devtools/debugging/default。 mspx
Windows 调试工具附带kill.exe。您可以使用它来终止任何符合您意愿的进程。
对于您的情况,只需执行,
http://www.microsoft.com/whdc/devtools/debugging/default.mspx
Debugging Tools for Windows ships with kill.exe. You can use it to kill any process that matches your wish.
For your case, simply execute,