web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

NullReferenceException in ILGeneratorAgent

(1) ShareShare
ReportReport
Posted on by 15
Hi to all,
 
In Visual Studio, Every time I save a modification to an AOT object or code I get the following error in the Error List:
 
Error - System.NullReferenceException: Object reference not set to an instance of an object.
- at Microsoft.Dynamics.Framework.Tools.ILGeneratorAgent.CompilationService.ParseTypeResolve(String module, String metadataPath, String compilerMetadataPath, IEnumerable`1 referencedAssembliesFolders, IEnumerable`1 elements)
 
Due to this, any warning or error related to the modified object are not evaluated/shown. It seems that on save VS is unable to evaluate the object or X++ syntax properly.
IntelliSense (or how is it called X++ code-completion aid) does not seem to work either properly.
 
Model build or Solution rebuild temporarily removes the problem and shows correct errors and warning in Error List, but any minor modification and save, will raise this error again. I also tried opening and closing VS.
As if something behind crashes (like a service) which is then not restarted until Dev Box restart.
 
My dev has had this issue since it was created so I doubt is a local configuration I made (which are just default for solution and project properties)
 
I have no Idea where else to look at or what else I could try try.
 
Other things I tried:
- Clean and rebuild
- Shut down IIS express and VS and restarted
- Unloaded and reloaded the project in the solution
- All the above together as /clean, unload, shut down IIS express and VS, restart VS (and IIS express), load and build/
I have the same question (0)
  • Judy Profile Picture
    Microsoft Employee on at
    NullReferenceException Microsoft.Dynamics.Framework.Tools.ILGeneratorAgent.CompilationService
    Hi Sir,
     
    I am not sure about this, if the issue persists, it is highly recommended that you create a ticket with Microsoft for further investigate.
     
    Best Regards,
    Judy
  • Verified answer
    LCAS Profile Picture
    15 on at
    NullReferenceException in ILGeneratorAgent
    @Judy
    Thanks, that was my next step. Only problem is that I don't really have repro steps and I think it will be hard to get a proper answer or fix.
     
    It appears to be something happening now and then, even in the past, looking at the following:
     
    Although here the issue arises on build, whereas for me building clears the output and shows correct errors or warnings, if any.
     
    Now I managed to "solve" it by cleaning ALL Visual Studio cache and tmp files. Let's see if I get the problem again and if so, if this solution really helps.

    EDIT: Problem gets temporary solved by cleaning VS cache. In time it will come back still...

    I copy the main steps that helped in my case and in case the link is discontinued in the future:

    Please find visual studio 2022 cache folders by following:

    1. Component Cache

      Close Visual Studio (ensure devenv.exe is not present in the Task Manager) and delete the C:\Users\xxxx AppData\Local\Microsoft\VisualStudio\your version xxx\ComponentModelCache directory
    2. Temp folder

      Exit iisexpress.
      Delete the C:\Users\xxxx \AppData\Local\Temp directory

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,771

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 806 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 542 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans