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)

AX1004 Compilation Error

(0) ShareShare
ReportReport
Posted on by 456

When compiling any Dynamics AX model project on production server I get the following warning and error:

Warning
MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or
\C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets
Line: 983

Error
AX1004: Reference System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 was not a valid model assembly.
\C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll

There are no problems with the projects on the development server, everything is compiled without errors or warnings. But when I transfer projects to the production server compilation fails.

Has anyone else had this problem? Any idea on how to fix that?

 

 

*This post is locked for comments

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

    What happens if you follow the advice and install the SDK on the production server (or on a copy of the production system)?

  • Maxim Gorbunov Profile Picture
    456 on at

    Martin, thank you for your reply. Unfortunately installing the SDK did not help. I still get the same error when trying to compile a report project.

    I found the log files in the AppData folder. This is the log file from the development server, where report projects are compiled without errors:

    Build started 4/28/2014 8:56:31 PM.
    __________________________________________________
    Project "C:\Users\Maxim\AppData\Local\Temp\2\VSP4272.tmp\Microsoft Dynamics AX\Dynamics AX Model Projects\SysCompanySizeReport

    \SysCompanySizeReport.dynamicsproj" (Build target(s)):

    Target PrepareForBuild:
    Creating directory "bin\Debug\".
    Creating directory "obj\Debug\".
    Target CoreCompile:
    __________________________________________________
    Project "C:\Users\Maxim\AppData\Local\Temp\2\VSP4272.tmp\Microsoft Dynamics AX\Dynamics AX Model Projects\SysCompanySizeReport

    \SysCompanySizeReport.dynamicsproj" is building "C:\Users\Maxim\AppData\Local\Temp\2\VSP4272.tmp\Microsoft Dynamics AX\Dynamics AX Model Projects

    \SysCompanySizeReport\SysCompanySizeReport.dynamicsproj" (ResolveBusinessLogicLibraries target(s)):

    Target CopyFilesToOutputDirectory:
    Copying file from "obj\Debug\SysCompanySizeReport.Model.dll" to "bin\Debug\SysCompanySizeReport.Model.dll".
    SysCompanySizeReport -> C:\Users\Maxim\AppData\Local\Temp\2\VSP4272.tmp\Microsoft Dynamics AX\Dynamics AX Model Projects\SysCompanySizeReport\bin

    \Debug\SysCompanySizeReport.Model.dll
    Target GenerateRdlTask:
    __________________________________________________
    Project "C:\Users\Maxim\AppData\Local\Temp\2\VSP4272.tmp\Microsoft Dynamics AX\Dynamics AX Model Projects\SysCompanySizeReport

    \SysCompanySizeReport.dynamicsproj" is building "C:\Users\Maxim\AppData\Local\Temp\2\VSP4272.tmp\Microsoft Dynamics AX\Dynamics AX Model Projects

    \SysCompanySizeReport\SysCompanySizeReport.dynamicsproj" (ResolveBusinessLogicLibraries target(s)):


    Build succeeded.
    0 Warning(s)
    0 Error(s)


    Time Elapsed 00:00:04.34

     

    And this is the log file from the production server, where I get the compilation error:

    Build started 4/28/2014 8:50:15 PM.
    __________________________________________________
    Project "C:\Users\Maxim\AppData\Local\Temp\2\VSP6913.tmp\Microsoft Dynamics AX\Dynamics AX Model Projects\SysCompanySizeReport\SysCompanySizeReport.dynamicsproj" (Build target(s)):

    Target PrepareForBuild:
    Creating directory "bin\Debug\".
    Creating directory "obj\Debug\".
    Target GetReferenceAssemblyPaths:
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
    Done building target "GetReferenceAssemblyPaths" in project "SysCompanySizeReport.dynamicsproj".
    Target CoreCompile:
    C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll : error AX1004: Reference System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 was not a valid model assembly.
    __________________________________________________
    Project "C:\Users\Maxim\AppData\Local\Temp\2\VSP6913.tmp\Microsoft Dynamics AX\Dynamics AX Model Projects\SysCompanySizeReport\SysCompanySizeReport.dynamicsproj" is building "C:\Users\Maxim\AppData\Local\Temp\2\VSP6913.tmp\Microsoft Dynamics AX\Dynamics AX Model Projects\SysCompanySizeReport\SysCompanySizeReport.dynamicsproj" (ResolveBusinessLogicLibraries target(s)):

    Done building target "CoreCompile" in project "SysCompanySizeReport.dynamicsproj" -- FAILED.

    Done building project "SysCompanySizeReport.dynamicsproj" -- FAILED.

    Build FAILED.

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
    C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll : error AX1004: Reference System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 was not a valid model assembly.
    1 Warning(s)
    1 Error(s)

    Time Elapsed 00:00:06.40 

    What I found suspicious is that the sequence of targets is different in those files. Is that possible that MSBuild on my production server does not use valid targets file from the DynamicsTools folder? 

    The folder and the files exist on the production server, but I could not find how to check the exact command line which AX client uses to start MSBuild. Is there any way to do that?

  • Suggested answer
    Raúl Llorente Peña Profile Picture
    685 on at

    Today I run into this same issue in two servers of a customer of ours.

    Both servers had .NET 4.5, but the Ax VS projects targets .NET 4.0. For some reason, .NET 4.5 deletes 4.0 assemblies.

    You cannot install .NET 4.0 due to the presence of 4.5 (install program states that a newer version is found and won't install 4.0).

    You need to install "Microsoft .NET Framework-4 Multi-Targeting Pack, 83,4 MB, version 4.0.30319", but you cannot if you don't have VS 2010 installed.

    A good workaround that worked for me was to download VS 2010 Express C#, install it and uninstall it. This let's that required package installed.  ^_^

    Now all my Ax VS projects node compiles at all ^_^

  • Maxim Gorbunov Profile Picture
    456 on at

    Martin,

    I just had the same problem on another server and tested your solution again. You were right, it works.

    The only thing that you did not mention (and I did not guess that myself) is that I had to install .NET Development AND Intellisense and Reference Assemblies. I guess I missed that when testing your suggestion the first time.

    Thanks,

    Maxim

  • SC-19081230-0 Profile Picture
    7 on at

    Hi Martin/Maxim

    I have the same problem. Could you please share download links to the packages I need to download?

    Søren PC..

  • SC-19081230-0 Profile Picture
    7 on at

    During SDK install I get:

    :40:33 AM Thursday, August 21, 2014: [SDKSetup:Error] Config_Products_Install: Windows SDK Setup (failed): Installation of the "Microsoft Windows SDK for Windows 7" product has reported the following error: Please refer to Samples\Setup\HTML\ConfigDetails.htm document for further information. Stack:    at SDKSetup.Product.ConfigureNewProduct(ManualResetEvent CancelEvent)   at SDKSetup.Product.SetupProduct(TaskMode taskMode, ManualResetEvent CancelEvent)   at SDKSetup.ProductCollection.SetupProducts(TaskMode taskMode, DownloadManager downloadManager, ManualResetEvent cancelEvent)   at SDKSetup.ConfigProducts.DoCurrentTask(TaskMode Task)

    Any ideas?

  • Maxim Gorbunov Profile Picture
    456 on at

    Hi Søren

    Which version of Windows Server are you using? Try to look for Windows SDK for your Windows Server. There is an SDK for Windows 8 too.

    Best regards,

    Maxim

  • Maxim Gorbunov Profile Picture
    456 on at

    However, at this page - msdn.microsoft.com/.../hh852363.aspx - they say that Windows 7 SDK is the one that you need for the previous versions of .NET assemblies. So I'd try to download it from here - go.microsoft.com/fwlink

  • SC-19081230-0 Profile Picture
    7 on at

    Hi

    It is an Win Server 2008..

    Is there a special SDK for that?

    spc

  • Vikash Goyal Profile Picture
    50 on at

    Hi Maxim, Am facing the same issue. As per this blog we have to install .NET Framework 4  Multi-Targeting Pack. As per you, you are suggesting to install .NET Development AND Intellisense and Reference Assemblies. Do you have the exact link for both to share? Martin did share the link for SDK but not sure which one to install from that link.

    Appreciate for a quick response.

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