如何使 Web 应用程序项目与 IIS Express 和 SQL Server Express 独立?
如何使用 IIS Express 和 SQL Server Express 使 Web 应用程序项目成为独立的桌面应用程序?
对于“独立”,我的意思是单击 exe 文件启动我的应用程序(例如浏览器中的 start.aspx)。整个应用程序由许多在浏览器中运行的 aspx 文件组成。
现在:在 Visual Studio 2010 中按 F5 时,我的 Web 应用程序项目运行良好。
我的目标:我想在本地计算机上启动此项目,就像在 Visual Studio 中一样简单,但我该怎么做呢?
How can I make Web Application project a standalone desktop application with IIS Express and SQL Server Express?
With "standalone" I mean clicking on an exe-file start my application (e.g. start.aspx in my browser). The whole application consists of lots of aspx-files which run in a browser.
NOW: I have my Web Application project running fine when pressing F5 in Visual Studio 2010.
MY AIM: I want to start this project on a local machine just as easy as it is in Visual Studio, but how could I do so?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您误解了在 Visual Studio 中按 F5 时发生的情况。
当您按 F5 时,如果您使用的是 Visual Studio 开发服务器而不是 IIS,则该服务器将启动,并且可以为来自
localhost
上的应用程序请求提供服务。无论如何,Visual Studio 接下来都会启动默认浏览器并告诉它浏览到您的 Web 应用程序。桌面上启动的唯一应用程序是您的浏览器。当您的应用程序可供其他用户使用时,您需要将其部署到 Web 服务器。将其部署到 Web 服务器后,用户将能够打开浏览器并浏览到您的应用程序。
没有简单的方法可以将 Web 服务器、数据库服务器和 Web 应用程序打包到用户可以双击的单个 .exe 中。
You're misunderstanding what happens when you press F5 in Visual Studio.
When you press F5, and if you're using the Visual Studio Development Server instead of IIS, that server is started up, and can serve requests for your application that come in on
localhost
. In any case, Visual Studio next starts your default browser and tells it to browse to your web application. The only application being launched on the desktop is your browser.When your application is ready for other users to use, you will need to deploy it to a web server. Once it is deployed to the web server, users will be able to open their browser and browse to your application.
There is no simple way to package up a web server, database server, and your web application into a single .exe that a user can double-click.
我建议您查看此产品
http://ultidev.com/products/UWS-卡西尼号-Pro/Default.aspx
i recommend you look into this product
http://ultidev.com/products/UWS-Cassini-Pro/Default.aspx
您需要使用 SQL CE,它有许多限制,例如无法自动增量标识类型列。
You'll need to use SQL CE, which has a number of limitations, such as the inability to auto-increment identity type columns.
为什么要将 IIS 用于独立的桌面应用程序? Web 应用程序用于网络。如果你想要桌面,看看WPF的WinForms。我怀疑您是否会找到任何工具来为您进行转换,因此您必须将其设为手动过程。只是希望您有一个结构良好的网络应用程序。
当然,除非您只想从本地计算机 IIS 安装访问本地 Web 应用程序?如果是这样,那么只需像在服务器上那样设置 IIS,为自己分配一个本地主机端口来访问 Web 应用程序,然后创建一个链接到正确 URL 的漂亮桌面快捷方式
Why would you use IIS for a stand-alone desktop application? A web application is for the web. If you want desktop that look into WinForms of WPF. I doubt you will find any tools to do the conversion for you so you will have to make it a manual process. Just hope you have a well structured web app.
Unless of course, you mean to just access a local web application from your local machine IIS installation? If so, then just set up IIS like you would do on a server, assign yourself a port to the localhost to access the web application and then create a nice desktop shortcut that links to the correct URL