Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is COMPLUS_ZapDisable and why is it not set by default?

I know that setting COMPLUS_ZapDisable=1 will "disable debugging optimizations in Visual Studio," but I can't seem to find any references that tell me what that actually means.

  • What features/functionality are actually disabled by this setting?
  • What are the ramifications of always using this setting?
  • If the cost is that "[debugging] runs a bit slower," can we try to elaborate a bit? Is the difference significant? Does that difference scale with project size? Is it unbearable on larger projects? Etc.
    • I know this one is a bit more vague, but explanation is really what I'm after
  • Is there an actual known reason why this isn't set by default?
    • While opinions are welcomed, I'm really wondering about if there is a factual, known issue that disabling this setting by default addresses
like image 328
Zachary Kniebel Avatar asked Feb 18 '16 16:02

Zachary Kniebel


People also ask

How to install the <complus> element of the <ASP> element?

The <comPlus> element of the <asp> element was introduced in IIS 7.0. To support and configure ASP applications on your Web server, you must install the ASP module. To install the ASP module, use the following steps. On the taskbar, click Server Manager. - In Server Manager, click the Manage menu, and then click Add Roles and Features.

How do I disable the use of pre-compiled code?

However, you can disable usage of pre-compiled code by starting the process with the environment variable 'COMPlus_ReadyToRun' set to '0'. This will tell the .NET Core runtime to disable the use of pre-compiled images, forcing the runtime to JIT compile framework code. In the Solution Explorer, right-click the project file and select Properties.

What happens when you optimize your code?

When code is optimized, the compiler and runtime make changes to the emitted CPU code so that it runs faster, but has a less direct mapping to original source code. If the mapping is less direct, debuggers are frequently unable to tell you the value of local variables, and code stepping and breakpoints might not work as you expect.

How do I set up Com Plus in ASP?

In the Connections pane, expand the server name, expand Sites, and then navigate to the Web site or Web application that you want to configure. In the site or application Home pane, double-click ASP. In the ASP pane, expand the Com Plus Properties section and configure your desired settings.


1 Answers

Setting the environment variable COMPlus_ZapDisable=1 disables the use of all NGEN images (*.ni.dll). It can also be set in the registry, but that is not recommended as it would affect all .NET applications. You would normally only use this when debugging the application to get better call stacks. For better performance you can disable the use of NGEN images for only some assemblies with the environment variable COMPlus_DisableNativeImageLoadList (64bit only and needs .NET 4.6+).

For an extensive description see: https://github.com/Microsoft/dotnet/blob/master/Documentation/testing-with-ryujit.md

(In the current CoreCLR it seems DisableNativeImageLoadList has been removed.)

like image 82
WebDancer Avatar answered Oct 05 '22 17:10

WebDancer