IIS Add Managed Module error after moving from Windows Server 2016 to Windows Server 2022

chribonn 21 Reputation points
2022-06-11T08:43:26.38+00:00

I updated a VM running Windows Server 2016 to Windows Server 2022.

On Windows Server 2016 I was running ASP.NET 4.7.

After upgrading I get the error below if there is a C-Sharp program (I tested with a Hello, World! script) and I click the Add Managed Module option in IIS.

There was an error while performing this operation.  
  
Details:  
  
Cannot execute a program. The command being executed was 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe' /noconfig /fullpaths  
@"C:Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\<number>\<number>.cmdline".  

210436-hhjz7.png

The C-Sharp Compile (csc.exe) is present in the directory.

Any idea how I can diagnose the issue and solve it please?

Windows development Internet Information Services
Developer technologies ASP.NET Other
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. chribonn 21 Reputation points
    2022-06-17T11:18:34.887+00:00

    Hi @Bruce (SqlWork.com) ,

    I upgraded from Windows server 2016 to 2022.

    Is there a way I can get the behaviour I had. I would like to avoid installing visual studio.

    The video link I shared earlier in this thread shows that now when I place any C# code in the bin directory, IIS functionality is impacted.

    I would like to completely disable the rosyln compiler on this server (or website).

    Can this be done?

    Thanks


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.