Critical error: Failed to compile shadow assembly. error CS0433
search cancel

Critical error: Failed to compile shadow assembly. error CS0433

book

Article ID: 277023

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

During a reconfigure of the installed products (or during re-attaching the database), the following messages were noticed in the NS logs after SIM failed to reconfigure:

A critical error occurred:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Altiris.NS.Exceptions.AeXException: Critical error: Failed to compile shadow assembly.
 
error CS0433

 

 

Environment

ITMS 8.7

Cause

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs0433

Resolution

Try the following:

You will need to clear out the "Temporary ASP.NET Files" folder:

  1. Close SIM 
  2. Perform an iisreset
  3. Delete all the folders and files within the "Temporary ASP.NET Files" folder (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files)
  4. Open SIM and Restart reconfiguration process one more time.

Explanation

  • Step 1: remove resource locks from the folders/files we need to delete.
  • Steps 2-3: remove all of the old build files

 

Note:

In some rare cases, even with the mentioned fix mentioned here, you may need to verify the following:

Give your user (In our case, the «user» should be NS «App Identity») Full Access to the following folder: C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys (or C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys in previous OS versions).

We found that in some occasions the permissions in the machine keys directory needed to have the service account (App Identity) added instead of just administrators group:

  1. Change security on directory:
    • C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys
  2. Add your App Identity account, with the following minimum "Advanced" set of permissions:
    • Create files / write data

    • Create folders / append data

    • Write attributes

    • Write extended attributes

    • Delete

  3. After hitting apply, accept that 5 directories were "Access is denied", if any.