简体   繁体   中英

csc.exe has stopped working causes Server Error in '/' Application

When I run my application on VS2015 I get a window saying that csc.exe has stopped working like below:
在此输入图像描述

After I click to close the program I get another error in the browser saying:

Server Error in '/' Application.

在此输入图像描述

Detailed Compiler output looks like below:

C:\\Program Files (x86)\\IIS Express>D:_myURL\\bin\\roslyn\\csc.exe /t:library /utf8output /nostdlib+ /R:"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\mscorlib.dll" /R:"C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Runtime\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Runtime.dll"

What could be the issue?

I faced the same issue and I would suggest to follow the steps described here :

  • Close all instances of Visual Studio 2015 and if they don't do it automatically disappear, end tasks for all the VBCSCompiler processes.
  • In your Visual Studio project under Bin folder you will see a roslyn folder (new for VS 2015)
  • Delete the roslyn folder and all contents within.
  • Restart Visual Studio 2015
  • Re Build your project and all should be well again.

我也遇到了同样的问题。我删除bin文件夹中的文件并运行应用程序。问题已修复。

-532462766 according to my efforts to help you, is an error that occurs when an unhandled exception is thrown.

I am sorry, i cannot help you much. My suggestion is to start debugging your program, by either using a debugger, or by wrapping some bits of your code in try-catch blocks, like in the example below:

try {
    // Your code here
} catch (Exception e) {
    System.Console.WriteLine("Error caught"); 
}

And your details are very vague. I can only help If you show the line/group of code causing the error.

However , the fact that csc.exe stops responding is intriguing, You can try to uninstall .NET Framework and reinstall it, you can find the downloads here: https://www.microsoft.com/net/download And if reinstalling it doesn't help, I am terribly sorry.

For this kind of errors, I always go to Event Viewer eventvwr . Please expand Windows Logs and click Application.

在此输入图像描述

If you cannot see your entry, you can easily filter it out - right click on Application and choose Filter Current Log. Check Critical, Warning and error and push OK. After that, you'll see detailed information in main view.

Below steps are what i did and worked for me.

1. Remove virtual directory from the IIS.

  • Open IIS (Start -> Run -> inetmgr -> enter)

  • Find your project virtual directory (expand hostname -> Sites -> Default Web Site -> MyProjectName)

  • Delete the virtual directory (Right click -> Remove)

2. Create virtual directory again via the VS 2015

  • Switch to Visual Studio
  • Open project properties ( Right click to MyProjectName on the Solution Explorer -> Properties)
  • Open the Web tab from the left menu
  • Click Create Virtual Directory button Under the Servers section.

Run the project again and It's done.

Hopefully it helps to someone else.

]I found I had to end task "VBCSCompiler.exe" in TaskManager. There after I could successfully clean the solution /bin directory and the error disappeared.

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM