Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

NullReferenceException in ILGeneratorAgent

Posted on by 13
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/
  • Verified answer
    LCAS Profile Picture
    LCAS 13 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
  • Judy Profile Picture
    Judy 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

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,900 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,275 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans