I am fairly new with the .net core framework and I am not very experienced setting up IIS 10 and am having trouble getting this up and running. On the servers end I am running Windows Server 2016. I have installed IIS 10 with Management Services (see image below) and the .net framework 4.6 features (see image below).
After installing this I have downloaded and installed the Web Deploy package from Web Deploy 3.6 (Previously I was installing the Web Platform Installer and then installing Web Deploy from there).
After rebooting the system I've made sure that the services are running properly (see image below).
All seems to be correct so the next step was to create an IIS website I decided to nest the site under the Default Web Sites as seen below:
The site points to the default application pool since I did not create a new one. I modified the app pool to the following settings:
I also changed its Identity to NetworkService previously I tried it set to LocalSystem (See image below).
I also made sure the users IUSR and IIS_IUSRS have read, execute and write permissions to the web site directory and sub directories (See images below).
Once this is all done I install the .net core hosting bundle downloaded from .Net Core Hosting Bundle.
And finally in Visual Studio my project is a .net core 2.1 razor page project. When publishing my project I created a profile to publish it with the following settings:
My connection validated just fine so I hit Next and setup the next step with the following settings:
I save the profile then publish it and it works perfectly. If I check the server the files have all been published and seem to be correct. However if I try navigating to the page http://myserver/BlankLabel/ I get a 404 error (see image below). Now if I try navigating to the Default Web Site (http://myserver) that loads up just fine.
I would appreciate any help with this since I am not to experienced with setting this up and surely enough am missing something...
References
Host ASP.NET Core on Windows with IIS
Publishing and deploying a Razor Pages application to IIS on Windows
Deploying .NET Core apps with Visual Studio
Update #1
I attempted to create a new site under Default Web Sites and just add a plain index.htm page to see if it would load. Once I saw that it was working I published my application into this new site (created a temporary second profile to do this) and tried reloading the page. The outcome of this was that it resulted in the same original error (my index.htm file still remained in the folder along with the published files). I then deleted the published files and reloaded and once again it worked with the index.htm file... Clearly something is going on with the .net core 2.1 project and IIS not liking it...
Update #2
Just thought that I would add that the AspNetCoreModule is loaded and it is also set as the startup (see images below). So i guess it just seconds my previous update...
Update #3
Just adding the web.config file as requested (I also noticed the logs are off i will be setting them to true and see if it gives me any extra info):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\BlankLabel.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
I suggest to check your published ASP.NET Core web.config file and enable logging by setting stdoutLogEnabled=true.
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.
I'm running my Web Project in IIS.
It is a 4.0 Framework APP.
I have a Service.svc and I get this error when I run my Application.
"Could not load type 'System.ServiceModel.Activation.HttpModule' from
assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'"
I tried this --> aspnet_regiis.exe -iru which I found in a lot of forums and it didn't solve my problem.
Does anyone know another method ?
Try with
c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -iru
When multiple versions of the .NET Framework are executing side-by-side on a single computer, the ASP.NET ISAPI version mapped to an ASP.NET application determines which version of the common language runtime (CLR) is used for the application.
Above command will Installs the version of ASP.NET that is associated with Aspnet_regiis.exe and only registers ASP.NET in IIS.
https://support.microsoft.com/en-us/help/2015129/error-message-after-you-install-the--net-framework-4-0-could-not-load
I have Windows 8 installed on my machine, and the aspnet_regiis.exe tool did not worked for me either.
The solution that worked for me is posted on this link, on the answer by Neha: System.ServiceModel.Activation.HttpModule error
Everywhere the problem to this solution was mentioned as re-registering aspNet by using aspnet_regiis.exe. But this did not work for me.
Though this is a valid solution (as explained beautifully here)
but it did not work with Windows 8.
For Windows 8 you need to Windows features and enable everything under ".Net Framework 3.5" and ".Net Framework 4.5 Advanced Services".
Thanks Neha
Hello Thanks for the question;
To resolve: "Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'"
In Windows Features check all for .NET 4 Advanced Services & .NET 3.5
Just like Nicolas Gago I tried aspnet_regiis.exe -iru but it didn't work. After the features were on then it yellow screen error was gone. Thanks;
You can install these features on windows server 2012 with powershell using the following commands:
Install-WindowsFeature -Name NET-Framework-Features -IncludeAllSubFeature
Install-WindowsFeature -Name NET-WCF-HTTP-Activation45 -IncludeAllSubFeature
You can get a list of features with the following command:
Get-WindowsFeature | Format-Table
Ok, finally got it.
Change this line in %windir%\System32\inetsrv\Config\ApplicationHost.config
<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
To
<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler,runtimeVersionv2.0" />
If this is not enough
Add this following line to the Web.config
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
From the Server Manager's Features node, you can also remove some of the sub-items under the .NET Framework 3.5.1 Features that are installed by the activation of some of the other roles.
For instance, removed the WCF Activation Features as follows and our websites came back:
[x] .NET Framework 3.5.1 Features
[x] .NET Framework 3.5.1
[ ] WCF Activation
[ ] HTTP Activation
[ ] Non-HTTP Activation
Note: this did not require a restart for us.
In Windows server 2012. Go to ISS -> Modules -> Remove the ServiceModel3-0.
Details
http://msdn.microsoft.com/en-us/library/hh169179(v=nav.71).aspx
"This error can occur when there are multiple versions of the .NET Framework on the computer that is running IIS..."
I got this error after I accidentally published one website into the directory of another website. The two websites had different versions of .net. What fixed it for me was changing the application pool. To do that, in the IIS manager:
click the website => Advanced Settings... (on the right) => click to the right of Application Pool => a button with "..." should appear => select ".NET v4.5 Classic"
If that application pool doesn't work, try some of the others.
We are using a web service along side a web site and when we publish the web site it returns same this error. We found out that by going into IIS and removing the ServiceModel from Modules and the svc-Integrated from the Handler Mappings the error went away.
I am late, hope it will help someone ....This is a known issue with IIS 8.0
The solution is to delete the 3.x module and handler from IIS manager. You could delete them at the application or site level if you want to keep them in applicationHost.config. But I wanted to delete them from applicationHost.config. do the following steps:
In IIS manager, click the machine name node.
In “Features View”, double-click “Modules”.
Find “ServiceModel” and remove it.
Image 1 for Solve IIS 8 Error: Could not load type ‘System.ServiceModel.Activation.HttpModule’
Go back to the machine name node’s “Features View”, double-click “Handler Mappings”.
Find “svc-Integrated” and remove it.
Image 2 for Solve IIS 8 Error: Could not load type ‘System.ServiceModel.Activation.HttpModule’
You might changed the IIS features settings.The easy steps to resolve by open command prompt with run as administrator(For Windows Server 2008) and run the command
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -iru
this will set up ASP.Net 4.0 ,Then Reset the IIS by the command
iisreset
References:
https://support.plesk.com/hc/en-us/articles/213392249-ASP-website-shows-error-Could-not-load-type-System-ServiceModel-Activation-HttpModule-from-assembly
This issue occurs because the Applicationhost.config file for Windows Process Activation Service (WAS) has some tags that are not compatible with the .NET Framework 4.0.
Based on your environment, you have 4 workarounds to solve this issue:
Updating Applicationhost.config.
Perform ASP.NET IIS Registration.
Turn on the Named Pipe Activation feature.
Remove ServiceModel 3.0 from IIS
Check the detailed steps for each woraround at Solving Could not load type system.servicemodel.activation.httpmodule from assembly System.ServiceModel
delete the module which is identified in .Net error message , 1 down vote
In Windows server 2012. Go to ISS -> Modules -> Remove the ServiceModel3-0. (without number worked for me)
start-> Run--> c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -iru
I have created a cloud project with an MVC3 webrole (empty project, added homecontroller and view). When I debug(F5) it runs smoothly.
After installing DotNetOpenAuth 3.4.7.11121 via NuGet I get the following error:
Windows Azure Tools for Microsoft Visual Studio There was an error
attaching the debugger to the IIS worker process for URL
'http://127.255.0.1:83/' for role instance
'deployment16(82).WindowsAzureProject1.MvcWebRole1_IN_0'. Unable to
start debugging on the web server. See help for common configuration
errors. Running the web page outside of the debugger may provide
further information. Make sure the server is operating correctly.
Verify there are no syntax errors in web.config by doing a Debug.Start
Without Debugging. You may also want to refer to the ASP.NET and ATL
Server debugging topic in the online documentation.
Same thing happens on an MVC2 project on another machine.
Boils down to the following line of configSections in web.config (added by install-package DotNetOpenAuth)
<section name="uri" type="System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
What am I missing?
Seems like the mentioned line above from web.config can be deleted. Probably already included in machine.config or something.
And, when i hit debug on the mvc project it runs as expected. The error only happens when i debug the cloud project
Seems like deleting the mentioned line (section name="uri"...) fixes things in both debug and without debug.
I have not discovered any ill effects and logon with OpenID against Google with dotNetOpenAuth works.
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.