Migrating Umbraco 4.7.1 from IIS6 to IIS7 - iis

I have taken over an Umbraco (version 4.7.1) installation from a previous coworker. The server hosting the application must be shut down and therefore I'm migrating the application to a new server.
The old server is running IIS6, but the the new server is running IIS7.5. When I try to open the site on the new server, I get a "Object reference not set to an instance of an object" exception. The YSOD does not provide much info on what's going wrong (see below).
When I run the application locally in Visual Studio it works like a charm. Do any of you have a clue to what is going wrong?

Can I suggest that you take a clean web.config from the Umbraco 4.7.1 archive and try that first. You can download v4.7.1 from this unofficial archive http://code.leekelleher.com/umbraco/archive/
Merge your customisations into the web.config e.g. connection string and give that a go as I suspect your web.config is not migrated to IIS7.
I wrote a blog post a few years ago about migrating web.config files from IIS6 > IIS7 which may be of use if the above advice doesn't help:
http://www.prolificnotion.co.uk/use-appcmd-to-migrate-web-config-from-iis6-to-iis7/

Have you checked that your application pool is running the correct version of the .Net Framework? Also check the pipeline mode you are running - mine run in Integrated mode not Classic.
In the <system.webServer> node of your web.config locate the <modules> node and ensure you have the runAllManagedModulesForAllRequests attribute set to true as that has caught me out a few times. It should look something like this:
<modules runAllManagedModulesForAllRequests="true">
I suspect the latter advice is the one that will do it for you.
Simon

Just riffing on some of #Pronotion's suggestions ... I have occasionally had issues installing apps on new server instances and have had to reinstall IIS. It's a single command line: aspnet_regiis -i
Also from your screenshot, it looks like you are running a .Net 4 app pool. Umbraco 4.7.1 should be running under .Net 2 Classic app pool as far as I remember.

Related

How to host a asp.net core MVC app in IIS?

I am familiar with .Net in general but new to ASP.Net Core. I just had my first "self-hosted" ASP.Net Core MVC app running (created using templet and runs under Kestrel by default) . What I would like to do now it to host it in-process with IIS. But what I am struggling with is that I couldn't seem to find a clear and detailed instruction/document about what I need to do to get it to work. I have tried various configuration changes on my own but nothing works so far. I am running .Net Core 3.1 and using VS.Net 2019 on my Windows 10 environment. If someone could point me to the right direction it would be highly appreciated.
As far as I know, if you want to host the asp.net core application on the IIS. You should make sure you have installed the right hosting bundle.
Notice: No matter you use in-process or out-of-process, you all need install the IIS hosting bundle.
More details about how to install it, you could refer to this link.
After install the link, you could check your IIS module to make sure you have installed the right asp.net core module.
Then you could use VS to publish the application to right folder and create the IIS web site as below:
Create IIS website:

ASP.NET Core module not in IIS

I am keep getting 500.19(0x8007000d) error when running my .NET core project through IIS Express.
After a bit digging, it looks like IIS doesn't recognize <aspNetCore> as a valid element in the web.config.
Here are the things I've tried:
installed URL rewrite module as someone suggested installed
AspNetCoreModule throgh here:
https://www.microsoft.com/net/download/dotnet-core/runtime-2.0.5.
installed .NET Core Windows Server Hosting bundle.
I've tried adding it as a managed module and put the path for AspNetCoreModule, but looks like it doesn't fix the issue. Enable stdoutLog doesn't work, because it simply won't generate any log file.
Any idea on how to solve this?
I got it working finally. Because all my website is under the default website, I went to install AspNetCoreModule module for the default website.
After it was installed, I noticed a change in the web.config under the default website. At the same time, AspNetCoreModule module is also listed as Native module in the module section.
The real error message is web.config was trying to install AspNetCoreModule, but it is already installed. Then I deleted the <modules> section in the web.config under the default website and it worked...
The website used to work before I turned off/on windows IIS features. Really not sure what caused this...
Repairing the core server hosting from the add remove program did the trick -
It seems like IIS was installed or changed after core windows server hosting. According to Microsoft is such case you need to repair the hosting bundle
Add Native module with path C:\Windows\system32\inetsrv\aspnetcore.dll

Page keeps loading forever

Im using IIS 8.5 on Windows Server 2012 R2 so I add my Web Api but when I try to view the site it stays in a loading state like this:
Do not show any message or error just stays loading, I think that i miss some configuration or feature in my IIS but I don't know which one.
Edit: I use .Net framework, it is a REST .net web api like this reference, the IIS have installed .Net versions 3.5 and 4.5, it's IIS not the express and the default IIS website runs fine.
I would really appreciate any help.
Try to reduce the timeout settings to a minimum level, say 10 seconds.
See if it throws a Timeout error.
Without much information from your side its hard to judge.
Perhaps it could be an external service you are trying to access(Web service) or a DB connection?
Please check if the application pool you assigned to your solutions runs under the correct version of .net framework and in integrated mode. I had similar issues when trying to run an mvc app in classic mode. Check this out.
EDIT 1 - Reconfiguring IIS
If problems persists then try the ASP.NET IIS Registration tool. Execute the followig command as administrator:
aspnet_regiis -i
At the end of this post the different locations for aspnet_regiis are described. You should select a .NET Framework version corresponding to that of your project, run aspnet_regiis and assign the proper application pool to your app.

MSDeploy - Cannot deploy .NET v4.5 package to v4.0 Application Pool

After migrating TeamCity from one server to another, and also switching to Visual Studio 2013, our build fails when using MSDeploy to push a TC-built .zip package to IIS.
The application pool that you are trying to use has the
'managedRuntimeVersion' property set to 'v4.0'. This application
requires 'v4.5'
This is a strange error since my IIS server has .NET 4.5 installed and has been happily running and being deployed to for weeks, and a 4.0 application pool will run a 4.5 targeted app.
Unfortunately, the waters are muddied by the changes to TC and VS (2013) so what caused the issue I cannot be sure of.
Note: Our TC server only has Visual Studio 2012 on it, since I'm on MSDN and got early access to 2013. This could be the culprit, but doesn't make the issue any less odd.
I'd prefer not to disabled .NET runtime version checking at all (with IgnoreDeployManagedRuntimeVersion), but instead implicit set runtime version via DeployManagedRuntimeVersion:
<DeployManagedRuntimeVersion>v4.0</DeployManagedRuntimeVersion>
Some more details: http://techblog.dorogin.com/2013/11/deploying-45-projects-with-webdeploy.html
Open your .csproj file and set the following element:
<IgnoreDeployManagedRuntimeVersion>True</IgnoreDeployManagedRuntimeVersion>
Adding it just above this element helps readability:
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
Kudos to https://stackoverflow.com/users/1769923/abhishikt-n-jain for answering with this little-known config setting here:
MSBuild deploy failing after upgrade to .NET 4.5
If anyone knows why this happens, please feel free to add an answer.
Update
Disregard my comments below. While it got me past the deploy, I got a 503 Service Unavailable when I actually tried to run the web app. I backed out this change by setting the managedRuntimeVersion property back to v4.0 and added the IgnoreDeployManagedRuntimeVersion to my project. Then the deploy succeeded and the app worked. Dumb...
This happened to me after I installed .NET Framework 4.5.1 on a Windows Server 2008 R2 SP1 machine (as part of upgrading Powershell).
The IIS user interface on Windows Server 2008 doesn't give the option of setting the managedRuntimeVersion property to v4.5 even after that version is installed. However, this can be done on the command line using the appcmd utility as #3boysdad's answer shows.
appcmd is the command-line equivalent of managing IIS sites, apps, apppools, etc. It is located at %systemroot%\system32\inetsrv\appcmd.exe but it is not on the PATH as the following link explains:
http://www.iis.net/learn/get-started/getting-started-with-iis/getting-started-with-appcmdexe#HowToUse
I'm of the opinion that modifying your project (via the IgnoreDeployManagedRuntimeVersion or DeployManagedRuntimeVersion properties) is sub-optimal. The application pool should be set to use v4.5, and the only way to do that on Windows Server 2008 is to use the appcmd utility. #3boysdad's answer should be the accepted answer.
found this gem while hunting around for this same problem.
appcmd set apppool /apppool.name: <your app pool> /managedRuntimeVersion:v4.5
this will need to be executed in your \System32\inetsrv directory.

Azure - error on starting with multiple web role projects

If I have more than one webroles(projects, not instances) in my application, I get this error: (I only get it if I attach a web role. It works fine wit as many worker roles projects as I want)
Microsoft Visual Studio
Windows Azure Tools for Microsoft Visual Studio
There was an error attaching the debugger to the IIS worker process for URL 'http://127.0.0.1:5100/' for role instance 'deployment(21).CloudPOC.WebRoleToHostDataService.0'. Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information.
Click Help for more information.
OK
What is wrong here? I can't understand it and I need a webservice project!
Make sure you are starting the Azure project rather than the Web Project itself. You might have set the Web Role as the startup project, and if you do that you'll find that IIS runs the Web App rather than the Azure Dev Fabric, meaning any Dev Fabric specific stuff (like config settings per role) aren't available causing problems.
What you're meant to do is let the Azure Dev Fabric (Compute Simulator) fire up all your roles for you, and it'll also work out if it needs to open a web browser etc.
So right click on the Azure Cloud project, set that as the Startup Project, and try again.
Hope that helps,
Andy
EDIT thought of something else!
Make sure your web.config is compiling to allow debug="true". If you have added a new WebSite to your solution, it won't be so by default:
<system.web>
<compilation debug="true" targetFramework="4.0" />
I had similar issue which got resolved with following steps.
Make sure you have correct version of .net framework 4.0 is intalled. (.Net Framework 4.0.30319 is the latest version)
Uninstall if there isany other .Net 4.0 framework in present on your system by going to Add And Remove programs.
Go to %windir%\Microsoft.NET\Framework64 physical location and remove unwanted .Net framework 4.0 folder
I've also had this problem and it happened when I upgraded my app to 4.0... I ran without debugging and got the following error:
There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined
and after researching that error, I found this:
http://forums.asp.net/t/1571308.aspx/1
which says there's currently a bug w/ vs2010 and 4.0... I took the answers recommendation and commented out the extensions section and it worked for me... Another possible solution.

Resources