3

We have an MVC4 application that we would also need to distribute as a standalone (no network connectivity) desktop application. Rather than rebuild the HTML/JS front-end we would like to reuse that so in essence we're distributing a self-hosted HTML-view-based .NET MVC application. What we roughly envision is: MVC4 .NET DLL + JS libraries + Self-hosted HTTP core + self/embedded browser view. For this standalone desktop app, we're only concerned with Windows OS.

Question: Is that practically doable or just a theoretical idea? How would we practically go about achieving that? We are attempting to minimize codebase fragmentation (and duplicate maintenance). We anyways have to support IE for the "online" version of the MVC app.

To Clarify: The user experience we would like to have is:

  • Single large .exe file that encapsulates all resources within it
  • Double clicking it launches a rectangle window within which the HTML app is rendered. This would be similar to how iOS apps have an "HTML view" which uses the OS's in-built HTML renderer (on Windows I assume it's IE?)

2 Answers 2

5

Using the ASP.NET hostable web core will allow you to host the ASP.NET runtime in your application. This means you can create your own local webserver, running ASP.NET MVC, webforms, or any other frameworks you choose to use. Have a look at this blog entry.

This is separate from IIS and you do not need to need to set up or configure IIS; simply having the .NET framework installed is sufficient.

The way you would likely distribute this is as a folder installed to the hard drive.

0

In theory, you absolutely can do this.

The second half of that phrase is usually "but should you?"

You could create an installation package that does everything you need to install the site on a PC. It'll be a little more complex as you'll need to set up IIS.

You'll lose the ability to deploy a change once and have it reach all users like you usually would get with a web app. This is h same issue if you deploy a desktop app of course.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.