Website parser error - Cannot execute a program. The command being executed was "G:\PleskVhosts...

Programmer4Life 20 Reputation points
2024-10-21T00:33:55.09+00:00

I'm using Visual Studio 2022 with Visual Basic and .Net Framework 4.8.

My website was working fine, but after making a lot of changes, it suddenly gives a parser error and I have been unable to determine why. The only thing I can think of is that I kept getting a NuGet warning about something was deprecated. I thought I resolved that issue correctly after the site issue started, but maybe I did that and it caused the issue. Your help figuring this out will be greatly appreciated.

Full error with site details removed:

__**Parser Error Message: **__Cannot execute a program. The command being executed was "G:\PleskVhosts[mysite].com[myothersite].com\bin\roslyn\vbc.exe" /shared /keepalive:"10" /noconfig @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\62a24fa8\8f11c1f0\lumfyslf.cmdline".

Developer technologies | .NET | Other
Developer technologies | Visual Studio | Other
Developer technologies | ASP.NET | Other
{count} votes

Accepted answer
  1. SurferOnWww 4,706 Reputation points
    2024-10-21T03:23:58.44+00:00

    My website was working fine, but after making a lot of changes, it suddenly gives a parser error and I have been unable to determine why.

    I guess that "making a lot of changes" includes updating your project to use the Roslyn complier which is probably causing your issue.

    Similar issues have been reported as follows:

    Check the followings to see if your project uses the Roslyn complier:

    (1) NuGet package Microsoft.CodeDom.Providers.DotNetCompilerPlatform is installed.

    (2) There is the roslyn folder under the bin folder which include the Roslin compliers csc.exe and vbc.exe.

    (3) Your wab.config file includes <system.codedom> element which specifies compiler configuration settings.

    If the Roslyn complier is causing your issue the solution might be either:

    (a) Remove NuGet package Microsoft.CodeDom.Providers.DotNetCompilerPlatform, or

    (b) Give the worker process of IIS the right to execute the vbc.exe, or (Note that all the files of Web Site project or the .aspx files of Web Application project are compiled at the server side)

    (c) Pre-compile all the files into single assembly in the Visual Studio before deployment. See Precompiling Your Website.


0 additional answers

Sort by: Most helpful

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.