A website does not function after migration to modern IIS. The following message is shown:
Object reference not set to an instance of an object.
%plesk_dir%\\admin\\logs\\iis7nativeprovider.log can have the following error:
19:26:43.749749 4440 Exception occured: Configuration system failed to initialize
Invalid character in the given encoding. Line 250, position 21. (C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Config\\machine.config line 250)
Invalid character in the given encoding. Line 250, position 21.
In System.Configuration module
<----- issue is caused by the quotes (" instead of ” )
Some settings were moved from
machine.config file while transition from IIS6 (Classic mode) to IIS7 (Integrated mode).
Try to convert
web.config to the new version using the following command:
%SystemRoot%\\system32\\inetsrv\\appcmd migrate config "example.com/"
Also, its possible to convert
web.config for virtual directory using "example.com/virtual_dir/"
Note: The symbol '/' in the end of the name of the domain or virtual directory name is mandatory.