在没有Visual Studio的情况下运行ASP.NET Web Api 2应用程序 [英] Running ASP.NET Web Api 2 application without Visual Studio

查看:83
本文介绍了在没有Visual Studio的情况下运行ASP.NET Web Api 2应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一个私有项目开发一个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服务的教程(

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应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆