Compiling an ASP .NET website into an executable (with server) - asp.net

I remember many years ago using a program that would allow Classic ASP websites to be compiled into an .EXE and run as if they were under IIS. I used this program to create an interactive CD-ROM. Things like Request.QueryString() etc all worked as expected.
Does anyone know of a similar program that will do this for ASP.NET?
Thanks

UltiDev Web Server Pro. Its a free redistributable web server but requires it to be installed in the client machine.
http://ultidev.com/Forums/yaf_postsm2832_UWS-Screenshots.aspx#post2832

Microsoft calls it Hosted Web Core Applications :
"Hosted Web Core is a new feature in IIS 7 that enables developers to create applications that load the core IIS functionality. Applications that load the Hosted Web Core use a separate configuration file from IIS, and this feature enables software developers to customize the functionality for their applications. For example, you can write an application that uses the Hosted Web Core functionality to serve Web pages and applications from a Web site that is separate from the Web sites that are hosted by IIS on the same server. When the World Wide Web Publishing Service (WWW service) for IIS is recycled, your application will continue to serve Web pages to Web clients."

Not exactly, but you can pre-compile your application and ship it with IIS Express. But this won't be a single executable.

Related

Asp.net website not starting default.aspx (apache 2.4 on Windows 10 Pro; IIS 10)

So, I setup a Win10 box as an Apache server; built VS19 Asp.net webforms app, which works as expected when run in VS. published to the C:\Apache24\htdocs folder. Now, I setup port forwarding on my ISP-provided "Internet IP Address" to point to my local server. If I use any browser (outside of my LAN) to access that address (e.g. http://xx.yy.zz.qq - not showing actual IP for security reasons) I will see the page titled "index of /", and the list of files that I published to that htdocs folder. If I put in INDEX.HTML file in that folder, it will be displayed; but since I see Default.aspx as the 1st entry in the IIS Default Documents list, with NO index.html present, I still just see the list of files, not the aspx. I don't think the fact that I've not yet established a DomainName-to-IP binding should make any difference to this issue, but I can't be sure. Any thoughts? As you might guess, I've not done this before! :) ). TIA!
Jim
I made sure that the VS instance of the website was not running, just in case that might cause IIS confusion; but I don't think that would be the case.
As noted, I can't see how a non .net server going to run/launch/process correctly aspx pages that require IIS as the web server?
I mean, IIS can't run a web site designed for Apache, nor can say IBM "web spere" web server either.
I am trying "hard" to think how a application built in .net framework going to work with a web server that not designed to work with the .net framework?
I mean, if you have a computer, and have a word document, then you need word installed to work with that document.
If you have a PDF file on your computer, then you have to install some PDF software to use that PDF document.
A web server is not some "magic" box, but is a plane jane computer, with some software installed on it. So, if you build a aspx .net framework site in .net, then that computer will require the .net framework to have been installed, and require the correct type of software to work with those pages - in this case IIS.
Now, to be fair, you CAN do this with .net core, since .net core can run on quite much "any" computer (that supports nigex). However EVEN in that case, they FAKE and TRICK you, since how they achieve this "magic trick" is when you build the .net core application, the build process includes a WHOLE WEB SERVER as part of the build!!! (this lighter weight web server (kestrel) thus can work if you forward the ports and requests say from Apache, or quite much any web server. But MAKE NO MISTAKE here, a WHOLE .net core compatiable web server is included in that build, and thus that .net web server IS STILL required to run that .net code.
Unfortunately, the .net framework (as opposed to the .net core choice) does not upon build of your web site INCLUDE that WHOLE WEB SERVER as part of the build.
So, .net framework sites requite the correct software to work, and that correct software in this case is the web server called IIS (Internet Information Services).
You can no more suggest/attempt/assume that some program to load and read a PDF document is now out of the blue going to consume and work with Excel files, or word files.
hint:
Software build to a particular library of code requires the correct software to run and work. Kind of simple!!
So, a computer with a web server?
That is JUST a computer with software installed on it, and you need the correct software installed on that computer to consume the files etc. it was designed form.
Apache web server can no more consume a "application" or "web site" designed for IIS then it can consume other files etc. that are designed for use with a 100% different application. this is how all software works, and it not clear why you would think that Apache, or IIS, or word or Excel would work any different at all here?
Now, there was the "mono" project, and that was a port of .net framework that allowed the .net framework to run say on Linux, and there are some examples of some attempts to run aspx pages that way, but it is a galactic mess of epic proportions, and really not the way to go.
However, as stated, the .net core system DOES run on just about any platform, and it does have the above "magic trick" of being able to run on Apache, but behind the scenes, that software build actually includes a WHOLE WORKING web server that is .net core compatible, and that WHOLE web server is included with your build, and thus some are "fooled" by this magic trick that .net core web sites can run on Apache. They look like they can, but they are not, and in that example case (of .net core, NOT .net framework), the site seeming to work on the Apache web server? Nope, what occurs is the Apache web server simple hands off any web request to the REAL WORKING AND INSTALLED .net core web server!!! (thus Apache really only acts as a router, or "hand off" machine, and all the REAL web processing occurs in the .net core web server called kestrel).
So, you can do as you ask, but you would have to dump "web forms" and build the web site with aspx pages as a .net core web site. If you do that, then YES you can use Apache, and it will work, but behind the scenes, it ONLY works because that build process of the .net site ALSO includes THAT WHOLE COPY AND WORKING COPY of a .net core web server as part of the build. As noted, this magic trick option during the build process is NOT available for .net framework, but is most certainly available for the .net core choice.
So, in your case of using Apache? Software designed for a particular type of web server must use the correct type of web server. Same goes for IIS - it can't consume nor run a web site designed for Apache. I mean, how software works on your desktop is not any different then how software on a web server
The pages you have implemented with the .aspx are part of the ASP.NET Web Forms framework. This framework is part of the .NET Framework. The main server required to host Web Forms applications is IIS (Internet Information Services). Since you are working on a Windows machine, you can research how to setup IIS to host your Web Forms site if you wish. If you still want to use Apache as the front end for your site, you can even have it proxy requests to your site hosted in IIS, although there's probably little benefit and much complexity from such a setup.
Apache out of the box does not include support for hosting Web Forms applications. There is an open source project called Mono that seeks to implement an alternative version of .NET Framework and allows the use of alternative web servers such as Apache. But Mono has largely been superseded by .NET Core.
.NET Core is the official replacement for .NET Framework. It is open source and cross platform by default, and the ASP.NET Core web framework that runs on .NET Core includes a Kestrel web server. This can be utilized with Apache (or any other web server) in front of it, acting as a reverse proxy. It is not a magic trick, but a rather standard approach for web applications these days. However, ASP.NET Core does not include the Web Forms framework, so you would need to re-implement your application in a more modern alternative that's supported by ASP.NET Core if you intend to stay in the .NET ecosystem. There are many alternatives in ASP.NET Core including MVC, Blazor, Razor Pages, and Web API.

Why shouldn't I use IIS Express for ASP.Net Core development?

It seems that .net core needs to be published to run on IIS which means it's either impossible or impractical to debug through IIS, but it's fine with IIS Express. My more experienced colleagues insist that we should do all development with IIS and never IIS Express which is, in effect, saying we should not touch .Net Core.
1) How likely am I to find that the app which works on IIS Express doesn't work on IIS?
2) What's the best way to mitigate the downsides?
3) What should I tell my boss? (I really want to keep working with core)
There is no reason not to debug using IIS Express. You can verify that your deployment works on IIS by publishing to a staging environment or even a local IIS instance.
That being said, it is possible to debug IIS locally by using Attach to Process in Visual Studio if your coworkers simply refuse to use IIS Express.
Its a big difference between iis express and iis(server). on iis server you need to configure first the iis itself. register asp.net, set up .net framework,set up config file and so on..
But this would be a good practice for the developer, iis server deployment process. is a must.
Hope it helps your idea..
When working with ASP.NET Core & Visual Studio IDE, its better to use IIS Express (kestrel internally) for following reasons
Kestrel is a light weight web server built for ASP.NET Core apps. IIS Express will make use of it while development & debugging.
Hosting IIS for ASP.NET Core apps is for providing load balancing, SSL, gzip etc. So even if you host on IIS, then its fine but development experience will be less productive.
ASP.NET Core apps are cross platform so you can work on Windows, Linux & MacOS. With IIS your are limiting to Windows only
Core apps are not like traditional ASP.NET MVC 5 or Web form apps. They have being made easy for development experience.
I would suggest that think of IIS only during deploying Core apps for QA, UAT or PROD. For development need not host on IIS. Hope this helps

Create a folder on client machine from asp.net web application

I have a very silly question, Can I create a Folder in Client machine from a web application. I have tried to do that.
But I am unable to do so. I have created an asp.net web application using visual studio IDE. And when I executed the web application using visual studio the folder is created.
After that I hosted the web application in IIS and the tried to access the web application. The web application was accessed successfully but the folder was not created on the client machine.
Could you please suggest me the ways of how to do it.
Thanks.
ASP.NET is a framework for creating web sites. The application using ASP.NET is deployed to a web server, for instance IIS. When ASP code behind of aspx/ascx files or C# code of external components is called it's executed on the web server (IIS).
I assume you have implemented the code for creating a folder with C# code. This code is, as I said, executed on server. On your development machine you have client (which is web browser) and server (whis is IIS) on the same machine. So the folder was created.
When you have deployed the application to a separate web server then you separated web server from client. I think your IIS hosted application has created a folder on the machine where IIS were installed. Not on your local machine.
If you want to create a folder on client side you shouldn't use C# ASP.NET code.
You should do some research how to achieve it in other technology. Here's some link for it - How to Create a New Folder for Downloading a File

Migrate a ASP.Net application from one server to another server

I have developed a ASP.Net MVC 4 application with Visual Web Developer Express 2010. It was successfully published/deployed to a remote server A (development server) using the Web Developer's built-in publishing tool and it works perfectly on it IIS 7.0 with the web deployment component.
Now I want to deploy it to another remote server B (production server). This one sits in an isolated environment and does not have Internet access! Even if server B is a replica of server A, its IIS 7.0 does not have the web deployment tool component installed. So the built-in publishing tool does not work for the web deployment option.
I then tried to publish it using the File System option. I copied the exported files to a new folder on IIS on server B. The folder was configured the same way as its counterpart on server A. I tried the URL on server B and it just gave me directory/files listing on the browser instead of the welcome page of the application.
Has anybody got the experience or tips to solve the issue? Thanks.
Cheers,
Alex
edit:
because it a MVC site, the default document doesn't apply. check the following steps:
IIS Extension Less URLs are enabled and allowed.
ASP.NET 4.0 is installed and registered. C:\Windows\Microsoft.NET\Framework\<version> and then aspnet_regiis -i (this will typically force IIS to use the MVC infrastructure instead of using the default document methodology)
Ensure App Pool is in 4.0 Integrated mode.
Ensue that the IIS Advanced Settings for the website are showing the right root folder path.

Deploying ASP.NET MVC to windows server 2003?

Short Version
I am a beginner program and my experience with launching programs is essentially hitting f5 in visual studio. How do I deploy an ASP.NET MVC app on a windows 2k3 server? When deployed, how would I access/run the site?
Long Version:
I am attempting to launch a simple ASP.NET MVC application to my company's win 2k3 server. I have included the binaries (for the MVC architecture, System.Web.Mvc, etc.) in my project as I am unsure if sp1 for ASP.NET 3.5 is installed.
I have absolutely no experience with server deployment, outside of deploying a simple ASP classic site on my localhost, so far I've been coding with the development server.
What is the process? When I click publish from Visual Studio, I select disk path and place it on my desktop, and then I transfer that folder to the server directory I want. The directory currently works with classic ASP pages, so I am placing my mvc app in a folder in that directory.
How do I access my site? I've tried \server\directory\MyMVCAppFolder\Home and several variations. (I changed my routing in Global.asax to account for .aspx extension, which is a nessecary evil dealing with win 2k3's IIS6)
In summation, how do I deploy a ASP.NET MVC site just having access to the server directory I wish to publish it, and how do I access it as an end user?
Read through this:
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

Resources