0

I have a asp.net Web Forms app that I am migrating from a Windows 2012 r2 server to a Windows 2022 server. I ported over the application to the new server and the app didnt work, seems it cant find the .ascx files. I noticed when I try and access the web.config settings via IIS i get an error. this worked fine on my Win 2012 server. Any idea why this may happen?

I have checked the install of IIS and I have all the 'features' of my old IIS installed. It seems really bizzare.

TIA

enter image description here

user13714356
  • 99
  • 1
  • 7
  • 1
    It could be permissions, and you could try launching IIS manager as admin. However, that error also occurs when web.config is not valid. I would open web config with visual studio - see if the editor catches any errors in the markup. – Albert D. Kallal May 27 '23 at 15:25
  • 1
    Check what is installed on the 2012 server and check if the same is installed on the 2022 server, not just features but other things as well (like the IIS rewrite module). – VDWWD May 27 '23 at 22:21
  • 1
    Something is wrong with your `web.config` and likely 500.19 errors occurred. If you don't share the contents, nobody might have the magic to help. – Lex Li May 28 '23 at 00:16
  • 1
    It looks like some configuration section is not recognized by IIS in the web.config, so please check if you have missed any IIS feature or [URL rewrite module](https://www.iis.net/downloads/microsoft/url-rewrite), here is the same error you can use as reference: [There was an error while performing this operation](https://stackoverflow.com/questions/22199424/there-was-an-error-while-performing-this-operation). – samwu May 28 '23 at 08:41
  • You are a star, it was the IIS rewrite module that I was missing. Thanks ever so much for your help!! – user13714356 May 28 '23 at 13:19

1 Answers1

1

Do you know if IIS could change configurations on the older site? (I'm asking, since I would suggest that the previous server could not open that web.config file either!!!).

That error occurs when web.config is not valid. I would open web config with visual studio - see if the editor catches any errors in the markup.

I suppose it could also be say permissions, and you could try launching IIS manager as admin, but best bets so far is incorrect xml in the web.config file.

You can verify/test this effect by re-name of web.config (or copy), and then empty it out - you see that now IIS can open + use the web.config file.

So in most cases, that error means the web.config is not a valid config file. Fix the bad or mal-formed XML in that file, and IIS should then be able to open it.

Albert D. Kallal
  • 42,205
  • 3
  • 34
  • 51