问题描述
我正在为一个私有项目开发一个ASP Web API 2 Web服务.我创建了一个webservice-project,其中包括所有文件夹(App_Data,App_Start,Controllers ...)以及我的所有类/功能.
I'm developing a asp web api 2 webservice for a private project.I created a webservice-project which includes all the folder (App_Data,App_Start,Controllers,...) and all my classes/functionallity.
现在,我想将其作为自托管Windows服务运行,或者从命令行运行,以在不运行Visual Studio的情况下测试所有功能.
Now I would like to run it as a selfhosted windows service or from command line to test all the functionallity without running Visual Studio.
我发现的所有内容都是关于如何创建新的命令行程序和创建新的Web服务的教程( http://www.asp.net/web-api/overview/hosting-aspnet-web-api/use-owin -to-self-host-web-api )....但是,我该如何自我托管创建的webservice-project并使用其WebApiConfig?
All I found was a tutorial how to create a new command-line programm and create a new webservice (http://www.asp.net/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api) ....But how can I just selfhost my created webservice-project and use its WebApiConfig??
更新1
至少我发现了如何从命令行启动IISExpress来在没有Visual Studio的情况下测试我的Web服务:我必须运行这个:
at least I found out how to start the IISExpress from CommandLine to test my webservice without VisualStudio:I had to run this:
C:\Program Files\IIS Express\iisexpress.exe /config:"C:\Users\Tobias\Documents\IISExpress\config\applicationhost.config" /site:MyWebservicename
推荐答案
您可以尝试
C:\Program Files\IIS Express\iisexpress.exe /config:"C:\Users\Tobias\Documents\IISExpress\config\applicationhost.config" /site:MyWebservicename
这篇关于在没有Visual Studio的情况下运行ASP.NET Web Api 2应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!