简体   繁体   English

在本地(脱机)和没有IIS运行Web应用程序

[英]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: 有了约束:

  1. No IIS required. 不需要IIS。
  2. Working with .NET 4.0. 使用.NET 4.0。 (OWIN 2.0 - Not good) (OWIN 2.0 - 不好)
  3. No internet require. 没有互联网要求。
  4. No installation required to the computer ill pass this web app. 计算机无需安装即可通过此Web应用程序。
  5. The server side code wont be expose when I send this application to my friends. 当我将此应用程序发送给我的朋友时,服务器端代码不会公开。

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.

相关问题 在Android上离线运行Web应用程序 - Running web-application offline on android 在IIS上运行的Web应用程序缓存数据库数据 - Web application running on IIS caches database data 检查IIS应用程序是否正在运行而不导致其运行 - Check if IIS Application is running without causing it to run 没有IIS的C#Web应用程序 - C# web application without IIS 在 IIS 上启动 .NET Core Web API 时出错:“应用程序正在 IIS 进程内运行,但未配置为使用 IIS 服务器” - Error on starting .NET Core Web API on IIS: "Application is running inside IIS process but is not configured to use IIS server" ASP.NET Core 2.1 App在本地构建和运行成功,但无法通过Web Deploy发布到IIS - ASP.NET Core 2.1 App succeeds in Building and Running Locally but fails to Publish to IIS via Web Deploy 运行 exe 的 ASP.NET Web 应用程序在 VS 中工作,而不是在 IIS 中 - ASP.NET Web application running an exe works in VS, not in IIS 运行 razor 托管页面,blazor web 程序集,IIS 上的应用程序 10 - Running razor pages hosted, blazor web assembly, application on IIS 10 在IIS模式下在Web应用程序中无需预览即可打印rdlc报告 - Printing rdlc report without preview in web application in IIS mode 是否可以在没有IIS(非Web API)的情况下自行托管MVC 4应用程序? - Is it possible to self-host a MVC 4 Application without IIS (not Web API)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM