[英]Running Web Application Locally (Offline) & without IIS
I'm trying to understand if there is a way to make a web application run on the local computer(browser) without IIS. 我试图了解是否有办法在没有IIS的本地计算机(浏览器)上运行Web应用程序。
My main objective is to transform my web application (that is on the internet) to a software that runs on the local computer without using the internet and without IIS. 我的主要目标是将我的Web应用程序(即在互联网上)转换为在本地计算机上运行的软件,而无需使用互联网和IIS。
My idea is to distributed my webapp between my colleagues and not forcing them to work online and not needing an internet connection. 我的想法是在我的同事之间分发我的webapp,而不是强迫他们在线工作而不需要互联网连接。
I have a MVC web app with 3 pages and a couple of methods on the server side. 我有一个 MVC Web应用程序有3页和服务器端的几个方法。
The idea of the application is to get proprieties from a form that I implemented on one of the pages of my web application and transform the proprieties on the client side to JSON and send it to the server, the server will generate XML file according to the JSON object and let the client download the XML file that were generated. 应用程序的想法是从我在我的Web应用程序的一个页面上实现的表单中获取属性,并将客户端上的属性转换为JSON并将其发送到服务器,服务器将根据JSON对象,让客户端下载生成的XML文件。
The flow of it: 它的流程:
1.The Client fill the form in my site. 1.客户填写我网站上的表格。
2.The form become JSON object on the client side. 2.表单在客户端成为JSON对象。
3.The JSON object that stored the properties of the form(filled by the client) is send to the server. 3.存储表单属性(由客户端填充)的JSON对象被发送到服务器。
4.The server get the JSON object and generated XML document from it. 4.服务器从中获取JSON对象并生成XML文档。
5.The client download the generated XML file. 5.客户端下载生成的XML文件。
Very simple web application. 很简单的Web应用程序。
I know that I can run HTML page by clicking it and the page will display on the browser but I need the server side to be working too to carry out actions. 我知道我可以通过点击它来运行HTML页面,页面将显示在浏览器上但我需要服务器端才能执行操作。
So my question is : How can I make my web application run without internet ? 所以我的问题是 :如何让我的网络应用程序在没有互联网的情况下运行?
With the constrains: 有了约束:
I read a couple of articles about OWIN, SingalR, Cassini and WCF but its all very vague... 我读了几篇关于OWIN,SingalR,Cassini和WCF的文章,但它们都很模糊......
If someone could provide me with a guide lines it will be very helpful. 如果有人可以为我提供指导,那将非常有帮助。
Thanks a lot. 非常感谢。
You can definitely self host a .NET web application using OWIN. 您绝对可以使用OWIN自行托管.NET Web应用程序。 Unfortunately documentation and information about it is vague and confusing at best.
不幸的是,关于它的文档和信息充其量是模糊和混乱的。 The fact that you're using MVC makes it somewhat easier as you may be able to directly use the self-host packages from Nuget for self hosting Web API.
您正在使用MVC这一事实使得它更容易,因为您可以直接使用Nuget的自主程序包来自托管Web API。 There may be similar packages for MVC.
MVC可能有类似的包。
I don't have recent experience but a Nuget search for "MVC Self Host" should yield some results. 我没有最近的经验,但Nuget搜索“MVC Self Host”应该会产生一些结果。
Below is a link with an example. 以下是一个示例链接。 But the term you are looking for is definitely "self host".
但你所寻找的术语绝对是“自我主持”。 It can be done via a console window or (more complex) a windows service.
它可以通过控制台窗口或(更复杂的)Windows服务来完成。 It will likely use some form of OWIN but you can probably find some startup code to copy and paste into your project, usually in the form of a Startup.cs file.
它可能会使用某种形式的OWIN,但你可能会发现一些启动代码要复制并粘贴到你的项目中,通常是以Startup.cs文件的形式。
http://www.c-sharpcorner.com/UploadFile/4b0136/working-with-owin-hosting-and-self-hosting-in-Asp-Net/ http://www.c-sharpcorner.com/UploadFile/4b0136/working-with-owin-hosting-and-self-hosting-in-Asp-Net/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.