IIS no longer working after Export configuration - iis-7

After following some instructions to Export Configuration from a 2008 server, IIS 7 to a 2019 server, IIS10 IIS on the 2019 server no longer works.
It's pointing at the 'Import' folder, which is where I placed the config files exported from the 2008 server.
I don't know how to reset the IIS 10 instance to just be a clean, normal edition and start from fresh.
I currently receive the message:
Failed to connect
Filename: ...Config\Import\administration.config'...
Error: The configuration section 'moduleProviders' cannot be read because it is missing a section declaration.
I want it to be looking at ...Config, not ...Config\Import.

I found that Disabling the IIS Shared Config did the trick
Powershell:
C:\> Disable-IISSharedConfig
https://learn.microsoft.com/en-us/powershell/module/iisadministration/disable-iissharedconfig?view=windowsserver2022-ps

Related

Publishing Net 6.0 asp net with Angular 13 template returns 404 for homepage

I've got a fairly new Asp Net 6.0 with Angular 13. The website works well with Visual Studio 2022, building and launching. We now want to publish the site to Azure App Service. We notice that after publishing with Visual Studio, or with GitHub Actions, we receive a 404 not found response when browsing to the home page. In order to debug this issue, we tried publishing the site locally and then running it:
dotnet publish -c Release
This command runs the "ng build --prod" command as expected and publishes everything to the bin/Release/net6.0/publish/ folder.
The Angular artifacts are all in the bin/Release/net6.0/publish/wwwroot folder, with an index.html file.
Then i run the dotnet assembly.dll command - the site starts:
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[14]
Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: (null)
info: Microsoft.Hosting.Lifetime[0]
Content root path: with path
However, I then receive the same 404 error. I've tried looking at the Developer Tools in Chrome, but nothing useful was found.
Does anyone have any idea why this is happening? I've tried amending the address in environment.prod.ts. This doesn't appear to help.
I've reproduced this on a mac and Windows machine.
I imagine the error is because some part of the startup can't be found. But how can I resolve please? thanks
I've put together an example of what i mean here: asp.net 6.0 angular. Please see the readme for instructions
this was a case of the backend url in the index.html being set correctly and also the static files in wwwroot not being served. running dotnet run does not server the static files.

Running Angular 4 + Core 2.0 on IIS failing to start up

I have an application written in ASP.Net Core 2.0 using the Visual Studio Angular 2 template that I can run successfully on my local IIS installation and local commandline but fails on Windows Server 2012 R2 Standard.
From my local command line I can run:
dotnet myApp.dll
And the application runs successfully until ASP.Net core 2.0. When I copy the deployed application to my 2012 server (where the Core 2.0 runtime as been installed), I cannot call the same dotnet command (both calls are from within the root deployment folder for the app myApp).
On my desktop, the result is a web site that is listening at 5000 (ASP.Net core 2's default port I'm assuming) when running from the published site locations.
However, when I run this same command on the server, I get the error:
Unhandled Exception: System.AggregateException: One or more errors occurred. (We
bpack dev middleware failed because of an error while loading 'aspnet-webpack'.
Error was: Error: Cannot find module 'aspnet-webpack'....
....
....
) ---> Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException:
Webpack dev middleware failed because of an error while loading 'aspnet-webpack'
. Error was: Error: Cannot find module 'aspnet-webpack'
When I look up aspnet-webpack from npmjs.com, I note that this module is "This NPM package is an internal implementation detail of the Microsoft.AspNetCore.SpaServices NuGet package" according to NPM.
I'm assuming that somehow my Core 2.0 install in missing or not able to reference Microsoft.AspNetCore.SpaServices, but at this point I'm not sure where I should be looking for this.
Thanks for any input.
Look at your system variables (right click My PC > Properties > Environment Variables). ASPNETCORE_ENVIRONMENT has to be set to either Staging or Production if you do not have the dotnet sdk installed.
Once you change that value, change it in your project (Properties > Debug tab) as well. Redeploy your project and restart your server. You should see the site working now.
Good luck!

IIS Failing to register

I have IIS Version 7.5 installed on my machine.
But when I am trying to register it using aspnet_regiis.exe -i(-ir) commands then the following error occurs:
Finished installing ASP.NET (4.0.30319.17929).
Setup has detected some errors during the operation. For details, please read the setup log file C:\Users\\AppData\Local\Temp\ASPNETSetup_00018.log
Steps Followed:
1. Installed VS 2012 First and then installed IIS.
2. Replaced applicationhost.config file from other machine where IIS was working with my file under folder C:\Windows\System32\inetsrv\config, but still not worked out.
3. Replaced the path in of applicationhost.config file with the absolute path but then also it didn't worked out.
4. Uninstalled IIS, VS2012 and then re-installed VS2012 and IIS, but then also success wasn't there.
Please help me to get out of this problem.
Thanks

error 1002: 'LMW3SVC/1/ROOT/MyFirstWebsite' is not a well formed IIS metabase path

I am trying to learn how to deploy my first website which is physically located here (C:\Users\Amal\Documents\Visual Studio 2008\WebSites\ErrorHandlingTest). I am using instructions from some book. after installing the Internet Information Services on my laptop which has Windows 7 ultimate on it. I added a virtual directory and gave it the alias (MyFirstWebsite). after that I was able to open the website just by typing
http://localhost/myfirstwebsite/mypage.aspx
on the address bar of my firefox v.21 browser.
the book then told me to do some code compilation to the website by using the command-line tool named aspnet_compiler.exe which is supposed to compile my website into binary files after running this command :
aspnet_compiler -m W3SVC/1/ROOT/MyFirstWebsite C:\MyFirstWebsiteDeply
but I got this error:
error 1002: 'W3SVC/1/ROOT/MyFirstWebsite' is not a well formed IIS metabase path.
I use asp.net 3.5 , visual studio 2008 , internet information services version 7.5.7600.16385
Try
aspnet_compiler -m LM/W3SVC/1/ROOT/MyFirstWebsite -f C:\MyFirstWebsiteDeply
You had missed the "LM" at the start of the metabase path.
Actually the iispath should be /LM/W3SVC/1/ROOT/XXX.
Pay attention to the '/' at the beginning.

Web Deploy script error - msdeploy.exe is not found on this machine

I'm trying to execute a web deploy script on a clean build Windows Server 2008 R2 machine and getting the following error:
ERROR: The system was unable to find the specified registry key or
value. msdeploy.exe is not found on
this machine. Please install Web
Deploy before execute the script.
The package was created in VS2010 and executes fine on my development box (as always!). If I import the package on the server through IIS everything works fine.
Web Deploy has been installed on the server through the Web Deployment Tool 2.1 via the Web P.I and I've verified the inclusion of msdeploy.exe. I'm running the script through the "IIS Extensions/Web Deploy Command Line" start menu item so I'm guessing that the correct paths should be set. I've also tried it as Administrator with the same error.
Any help greatly appreciated.
Copied from here:
There is an error with the way Microsoft’s Web Deploy 2.1 application creates command line packages from Visual Studio 2010.
If you create a package to publish and then try to run the msdeploy.exe command line publishing tool it on a production server running IIS then you may receive the following error:
ERROR: The system was unable to find the specified registry key or
value. msdeploy.exe is not found on this machine. Please install Web
Deploy before execute the script.
Assuming that you actually have installed Web Deploy from http://www.iis.net/download/WebDeploy then the error may be caused by an incorrect registry path variable in the .cmd file that Visual Studio creates.
Open up the .deploy.cmd file that is part of your deployment package in a text editor and look for the following code block:
if "%MSDeployPath%" == "" (
for /F "usebackq tokens=2*" %%i in
(`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1" /v InstallPath`)
do (if "%%~dpj" == "%%j" (
set MSDeployPath=%%j
If you have installed Web Deploy 2.0 or higher, then the error is caused by the registry query to HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1. If you open up regedit on your production server you’ll find that the appropriate key is actually HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\2.
Change the reference in the.deploy.cmd file and you’ll be able to successfully run the deployment package.
I have the same problem. Installed WebDeploy_2_10_amd64_en-US. Running the Deploy Command Line I get the same erorr. However, in IIS (version 7) I could use an option import application. With this option (right side of the window in the actions toolbar) I was able to import the application deployment package zip file. All settings were imported correctly except for the application pool. I only had to adjust that and everything was running fine.

Resources