在本地(离线)运行 Web 应用程序没有 IIS [英] Running Web Application Locally (Offline) & without IIS

查看:37
本文介绍了在本地(离线)运行 Web 应用程序没有 IIS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试了解是否有办法让 Web 应用程序在没有 IIS 的情况下在本地计算机(浏览器)上运行.

I'm trying to understand if there is a way to make a web application run on the local computer(browser) without IIS.

我的主要目标是将我的 Web 应用程序(在 Internet 上)转换为在本地计算机上运行的软件,而无需使用 Internet 和 IIS.

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.

我的想法是在我的同事之间分发我的网络应用程序,而不是强迫他们在线工作并且不需要互联网连接.

My idea is to distributed my webapp between my colleagues and not forcing them to work online and not needing an internet connection.

我有一个 MVC Web 应用程序,其中包含 3 个页面和服务器端的几种方法.

I have a MVC web app with 3 pages and a couple of methods on the server side.

应用程序的想法是从我在 Web 应用程序的一个页面上实现的表单中获取属性,并将客户端的属性转换为 JSON 并将其发送到服务器,服务器会根据JSON对象生成XML文件,让客户端下载生成的XML文件.

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.

流程:

1.客户在我的网站上填写表格.

1.The Client fill the form in my site.

2.表单在客户端变成JSON对象.

2.The form become JSON object on the client side.

3.存储表单属性的JSON对象(由客户端填写)发送到服务器.

3.The JSON object that stored the properties of the form(filled by the client) is send to the server.

4.服务器获取JSON对象并从中生成XML文档.

4.The server get the JSON object and generated XML document from it.

5.客户端下载生成的XML文件.

5.The client download the generated XML file.

非常简单的网络应用程序.

Very simple web application.

我知道我可以通过单击运行 HTML 页面,该页面将显示在浏览器上,但我也需要服务器端工作才能执行操作.

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.

所以我的问题是:如何让我的网络应用程序在没有互联网的情况下运行?

So my question is : How can I make my web application run without internet ?

有约束:

  1. 不需要 IIS.
  2. 使用 .NET 4.0.(OWIN 2.0 - 不好)
  3. 无需互联网.
  4. 无需安装即可通过此网络应用程序的计算机.
  5. 当我将此应用程序发送给我的朋友时,服务器端代码不会暴露.

我读了几篇关于 OWIN、SingalR、Cassini 和 WCF 的文章,但都非常含糊......

I read a couple of articles about OWIN, SingalR, Cassini and WCF but its all very vague...

如果有人能给我提供指导,那将非常有帮助.

If someone could provide me with a guide lines it will be very helpful.

非常感谢.

推荐答案

您绝对可以使用 OWIN 自行托管 .NET Web 应用程序.不幸的是,有关它的文档和信息充其量是模糊和混乱的.您使用 MVC 的事实使它变得更容易一些,因为您可能能够直接使用来自 Nuget 的自托管包进行自托管 Web API.MVC 可能有类似的包.

You can definitely self host a .NET web application using OWIN. 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. There may be similar packages for MVC.

我没有最近的经验,但 Nuget 搜索MVC Self Host"应该会产生一些结果.

I don't have recent experience but a Nuget search for "MVC Self Host" should yield some results.

下面是一个带有示例的链接.但是您正在寻找的术语绝对是自主机".它可以通过控制台窗口或(更复杂的)Windows 服务来完成.它可能会使用某种形式的 OWIN,但您可能会找到一些启动代码来复制并粘贴到您的项目中,通常以 Startup.cs 文件的形式.

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. 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.

http://www.c-sharpcorner.com/UploadFile/4b0136/working-with-owin-hosting-and-self-hosting-in-Asp-Net/

这篇关于在本地(离线)运行 Web 应用程序没有 IIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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