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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Community Module - Compile-AXIL

(0) ShareShare
ReportReport
Posted on by

Hello,

I used to just run a command line for CIL Generation. I changed to use the Community Module to easily add the timeout. I am running a powershell script via the Windows Task Scheduler at night. The Compile-AXIL seems to do nothing and then timeout. I have the timeout set to 2 hours. Prior to calling this, I wipe out any .netmodule, .log, .delete, and .pdb files out of the XppIL directory. No new files get generated. Through the task scheduler, I tell it to Run whether user is logged on or not and to run with the highest privileges. I also tell it to wake the computer to run the task. I cannot get it to actually generate the CIL. However, if I manually run the script, it runs just fine. I have DynamicsAxCommunity.psd1 and DynamicsAxCommunity.psm1 located in this directory: "C:\Windows\System32\WindowsPowerShell\v1.0\Modules\DynamicsAxCommunity" so the assemblies are loaded. I do not see anything in the event viewer that gives much info. I even added code to write to a DB in Class SysCompileIL, method generateIL, but nothing is written out when run through the Task Scheduler. When I manually open the .axc file, no windows pop up or anything that would stop the script from continuing.

Here is the line of code that is being run:

Compile-AXIL -ConfigPath "$Script:DBSyncAxc" -Timeout (New-TimeSpan -Hours 2).TotalSeconds;

It also seems to work on servers that use Powershell Version 3. The problem seems to be on servers that use Powershell Version 4.

Any ideas on this?

Thanks!

Tony

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Does it happen with Compile-AXIL only, or with other cmdlets as well (e.g. with DB synchronization)? If you run it manually, are you using the same account as the scheduled task?

    One of common problems is that people set a new account for builds and it gets the dialog for Customer Experience Improvement Program on logon. The cmdlet can neither detect the dialog nor close it, so it gets stuck.

  • Community Member Profile Picture
    on at

    When I run it manually, I am using the same account as the scheduled task.

    On one of our servers, the DB Sync works fine (but still has this issue with the CIL Generation). On another, it does the same thing as the CIL Generation - appears to not do anything and just times out. It might be different issues on these servers, but I'm hoping figuring out the CIL might shed some light on the DB Sync issue.

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Unfortunately it's difficult to say what happens in your system, especially if each of your server works differently.

    Does the problem occur if you run the Powershell script through runas (not as a scheduled task)?

  • Community Member Profile Picture
    on at

    Sorry - I need to correct my previous statement. The DB Sync does work fine. It was failing if the CIL Generation failed because I was wiping out the XppIL directory. I manually did a Generate Full CIL, which was successful. Then, I tried doing the scheduled task for DB Sync and it works fine. So the DB Sync does work fine on every server.

    I will look at the runas next and let you know. I was having issues with the double hop as we discussed previously, and I went with a simple Schedule Task instead.

  • Community Member Profile Picture
    on at

    Can you qualify what you want me to do with the runas? If I log onto the server and run the scheduled task, it works fine. If I log onto the server and run the script, it also works fine. In both cases, I am logging in as the Service Account. Do you want me to log onto the server as the service account and then run the powershell script with runas the service account?

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    If the scheduled task works fine, can you please explain again what's the problem?

  • Community Member Profile Picture
    on at

    The scheduled task only works if I log onto the server and run it manually. If I have it run at a scheduled time, it does not work.

  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Aha, so it's not actually a "scheduled" task.

    Are you sure that the script executes and it gets stuck exactly on Compile-AXIL? If not, there may be a problem with storing domain account passwords; Microsoft's released a hotfix for it. There can be many other causes, of course.

    If the script runs without problem until starting Compile-AXIL, how did you check that it "does nothing"?

  • Community Member Profile Picture
    on at

    I have logging in the script basically just saying what it's doing to a text file. Everything works up to the CIL Generation, which just times out. I do not think it does anything because it does not create/update the log file:

    C:\Program Files\Microsoft Dynamics AX\60\Server\AX_MIG\bin\XppIL\Dynamics.Ax.Application.dll.log

    It also does not generate any files (.netmodule, .pdb, or anything) in this directory:

    C:\Program Files\Microsoft Dynamics AX\60\Server\AX_MIG\bin\XppIL\

    I do not see anything in Event Viewer that stands out.

    I also put code in the SysCompileIL Class on the generateIL method to log to a db. However, nothing is put into the DB. I put this code in to try to debug the problem - the problem existed prior to adding this code.

  • Verified answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    You can also try to add a trace message to Info.startup(). If the clients starts but it doesn't get into SysCompileIL, you just have to find where exactly your system dies.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans