Application fails to launch when dynamically compiling DLLs using csc.exe

Version 1

    Verified Product Versions

    AppSense Application Manager 8.9AppSense Application Manager 8.8AppSense Application Manager 8.7AppSense Application Manager 8.6AppSense Application Manager 8.5AppSense Application Manager 8.4AppSense Application Manager 8.3AppSense Application Manager 8.2AppSense Application Manager 8.1AppSense Application Manager 8.0

    Introduction

    An application which compiles DLLs dynamically using the .NET Visual C# Command Line Compiler (csc.exe), such as Citrix Receiver, may experience sharing violations (Error 32) when compiling DLLs, causing the parent application to fail to run.

    Detail

    When Application Manager checks for Trusted Ownership, it attempts to aquire a shared lock on the file.

    If csc.exe attempts to acquire an exclusive lock at the same time (seen as an Overwrite-If request within Application Manager agent logs), the sharing violation occurs and csc.exe does not attempt a retry, causing the application to error.

    Rather than disabling "Enalbe Trusted Ownership Checking" and/or the "Change a file’s ownership when it is overwritten or renamed" options within General Features - Trusted Owners, it is preferable to exclude the blocked process from the filter driver using the ExProcessNames driver parameter registry value on the affected machine(s).

     

    Registry Key:  HKLM\Software\AppSense Technologies\Application Manager\DriverParameters

    Value Name:    ExProcessNames

    Value Type:    REG_SZ

    Value Data:    csc.exe

    The value data is a space separated list of processes to be excluded from the AMFilterDriver.

    This prevents any module load actions for csc.exe being processed by AmAgent.exe for rule evaluation, whilst still ensuring the initial launch (execute request) is still be subject to normal Application Manager rules processing.