Run ASP.NET project in IIS without "publishing" - c#

IIS 7.5 installed in windows features.
VS 2012 asp.net project.
There is a server with IIS and I need to upload asp.net application to it to make it available to local network. There is no VS installed in the server.
There is a developer PC with VS.
Is there a way to just upload updated .aspx and .cs files to IIS folder without publishing anything and so do updates to the local website? Publishing is not an option at all. And please don't say "but you still can publish it" or "why don't you want to publish".
My general task is to make the local website in IIS folder updateable by just uploading updated aspx files to the folder without freaking publishing anything. So I have this project folder on IIS server with all the aspx and cs files just like the original project and all I need is to throw updated files into it to update the app.
Project files are on the IIS server. So now I can see the content of the project folder in IIS manager.
Doesn't load any page, just loading and loading infinitely.

Related

How do I modify and deploy Edit.aspx in Kentico 7?

We are on kentico 7 and for some reason, none of my edits to Edit.aspx are showing up locally or on our dev server. Usually, I just modify a .aspx or .cs file on my local machine and they appear on my local server when I launch the site. Is there a special way to modify/deploy this file? The file full path is: site\CMSModules\Content\CMSDesk\Edit\Edit.aspx.
Best practice is to NOT modify any of the Kentico base files. BUT I'm assuming here since you're on v7.x that you're most likely not upgrading to a new version any time soon so this will come down to how your site is set up. Is it a website or a web project? Website will have an /App_Code directory.
If you have an /App_Code directory, then you'll make the changes to your ascx and .cs files and copy them to your production server. If you have a web project, then you'll need to build the project and redeploy the site, including the new dll, to your production server.
Don't ask how to copy the code to your servers because that will be something you need to figure out on your own on how to access your production servers. Don't reply with any of your dev or prod server info, it's not a good idea at all.

Cannot run Simple ASP.NET MVC Application with Visual Studio 2015 from IIS (Internal Server 500)

Windows 10 Professional
IIS 10
Visual Studio 2015 (Running as Administrator)
I want to run from IIS instead of IIS Express as I have an external IP pointing to my machine and I will be receiving messages from an external source. Ultimately I will be using WebAPI but for testing and setting up IIS I am using a simple ASP.NET MVC 5 Web Application.
I created a new ASP.NET MVC 5 Web Application, this is the skeleton Visual Studio 2015 MVC Template, I then ran the application using IIS Express, no issues:
I then went to IIS 10 and created a new website with "localhost" as the binding:
The Physical Path for this new website in IIS is C:\inetpub\wwwroot\AspNetMvcTest:
I then went to the web application properties and switched to IIS. I was asked if I would like to create a new Virtual Directory:
I clicked Yes, if you click No the operation will be canceled and you unsaved Web Application Properties. You have to click Yes to change to Local IIS Property in Visual Studio.
I then was told that IIS "localhost" was mapped to a different folder and would I like to remap:
I clicked Yes. If you click No you will have unsaved Web Application Property changes again and you will not be using Local IIS in Visual Studio.
This is interesting Visual Studio is trying to change the "Virtual Directory" because it will actual change the Physical Path of the IIS Website not add a Virtual Directory. A Virtual Directory is a folder, somewhere outside of the Physical Path of the IIS website that IIS will treat as is part of the Physical Path folder. But I digress.
Now I am told that the "Virtual Directory" was created successfully:
Now we can look at the changes Visual Studio 2015 made to IIS 10:
We have no Virtual Directories on the website bound to localhost:
My Physical Path has been changed by Visual Studio 2015 and it is mapped to my the directory my simple ASP.NET MVC 5 Web Application resides:
So even though Visual Studio 2015 uses the "Virtual Directory" when changing the ASP.NET MVC 5 Web Application Properties, Visual Studio 2015 was only concerned with the Physical Path and that is the only thing it changed in IIS that I can see.
Now for the Internal Server Error 500 Details
I press F5 in Visual Studio 2015 and F12 Tools says there is an Internal Server 500 Error:
If we inspect the request and response in Fiddler, there 500 Error has a Content Length = 0
To try and get more details of the 500 error I have turned Custom Errors off in my Web.Config and also added httpErrors Detailed and PassThrough:
I added "catch all" exceptions handling to Global.asax, no breakpoint hit:
Here is my Call Stack, which is empty and neither breakpoint in screenshot is ever hit:
I added a Console Application to my solution as "Set As Startup Project" and here is my Call Stack proving a break point can be hit:
Here is a screenshot of Event Viewer -> Application, I cleared the Application log, pressed F5 in Visual Studio 2015, refreshed the Application log and it is empty still:
I thought the issue is folder permissions after Visual Studio changed the Physical Path
So I added IIS_IUSRS and gave Full Control even though the Account does not need that high of a level of permission to the Physical Path directory:
My ApplicationPoolIndentity is Framework v4.0 and ApplicationPoolIdentity The ApplicationPoolIdentity is assigned membership of the Users group as well as the IIS_IUSRS group:
I tried adding the specific Application Pool to the Security properties of ASP.NET MVC app Physical Directory, so first I found the process Visual Studio F5 was attached to:
I added "DefaultAppPool" and my IIS Application Pool "IIS APPPOOL\AspNetMvcTest" to the Physical folder Security.
I added index.html to the Web Application Physical Folder and that does not work:
<html>
<head>
</head>
<body>
<h4 style="color: black">hello world</h4>
</body>
</html>
I have moved the IIS website Physical Path to inetpub/wwwroot back to the directory I created when I created the website, I cannot even browse to a simple HTML file, I get the same empty 500 error
So now I am stuck and do not know what else to do.
TL;DR
Before reading the rest of answer it is likely you just need to run aspnet_regiis which you can do from cmd or via a cool tool in Web Platform Installer, if you search "ASP.NET" there is a handy "Execute ASP.NET IIS Registration tool" you can install.
Original Answer:
Thanks for all the help from everyone, first thing I should have done was taken a step back and tested an index.html "Hello World" test file from a IIS Website with c:\inetpub\wwwroot as the Physical Path of the IIS website.
When you first install IIS you have a default website, browse to it and make sure that works. Is a great first start to a new machine. But I just deleted that IIS site after installing IIS
Steps I took for fix:
I uninstalled IIS via Control Panel -> Programs and Features ->
Windows Features.
Restarted my computer
Installed IIS for Windows 10 following this document
Tested IIS by creating a Website, using the DefaultAppPool and then browsing localhost, and that worked (again when you first install IIS you have this website but I deleted it on mine a couple days ago)
I Found that my simple ASP.NET Website still did not work though and it was published to c:\inetpub\wwwroot\AspNetMvcTest so it was not a potential folders permission issue. When browsing, instead of loading my ASP.NET Website IIS redirected to the root c:\inetpub\wwwroot and displayed its IIS Welcome page ("iisstart.htm")
This means I needed to run aspnet_regiis, which I did, via cool tool in Web Platform Installer, if you search "ASP.NET" there is a handy "Execute ASP.NET IIS Registration tool" you can install.
That was it, I was all set, ASP.NET MVC Website started working from IIS immediately upon refreshing my browser (localhost in Location bar).
I think the main problem is that ASP.NET MVC 5 web requires .NET Framework 4.5 at least. From your provided information, the application pool of your web application was using .NET 4.0. It look like you've not registerd ASP.NET 4.5 with your IIS yet.
To register ASP.NET 4.5 with IIS, you could use using Visual Studio's command prompt (as an Administrator), go to the following directory and run the commmand aspnet_regiis.exe -i
C:\Windows\Microsoft.NET\Framework64\v4.5.<version>
After successfully register ASP.NET 4.5 with IIS, change your web application to use .NET 4.5 application pool.

What is contained in a published ASP.net project?

I developed a site in asp.net using C# as the language.
I have debugged it and no more errors can be found and can also view the page from a browser.
I would like to host this site and direct a client to it for demo purposes but am having a problem each time I publish my site. The publishing only does away with all my .aspx.cs files but I don't see any .exe file that I can install or send to my hosting provider.
I would like to know if this what I am experiencing is normal or there are settings I need to do in my visual studio 2013 ultimate edition for these tasks to be performed?
Kindly advise me on the way forward
ASP.NET applications (not "ASP.NET websites") are compiled into a .dll file in your bin folder, which is then deployed on to the server.
Your .aspx/.cshtml1 files reference compiled classes and types contained within this DLL, thus eliminating the need for source files.
There won't be any .exe files, you need to deploy your project to a web server, like IIS. Check out this link.

Build an ASP.NET website project in VS 2012 without the .cs files

How can i build my ASP.NET website project so that it will be ready to upload to the hosting server without the .cs files.
I can use the Web Publish protocol as it is not available in my hosting company.
Use Publish/Deploy to a local folder and then ftp/copy that folder upto your hosting provider

How do I unpublish a .Net application

I published a C# .net application to the wrong folder. I am using VS 2005. How do I unpublish the app to be able to republish in the correct folder.
I tried simply publishing to another folder and now the app will not run from either location.
You will need to manually delete all the published files from the wrong folder.
There is no "recall"/"unpublish" function in VS. All "publish" does is compile and copy compiled files and other included files and folders (images, css, js etc) to the specified directory.
Publishing is essentially just a copy of the built application to the destination folder, as far as I aware. This points to a different problem in your application as being the source of your error.
More than likely your app isn't working from either folder because it's configured to use asp.net 1.1 or doesn't have asp.net installed at all on the server. If it is installed, and both 1.1 and 2.0+ are installed, it will default to 1.1, and the folder needs to be configured to use 2.0+.
But other than that, you just delete the files from the server by hand.
Publishing function also creates "Application" on the IIS, so I would probably start by opening the IIS server with "Internet information services manager", and remove the application with the wrong folder.

Categories

Resources