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 :
Microsoft Dynamics AX (Archived)

MSB3270 version mismatch warning

(0) ShareShare
ReportReport
Posted on by

When I compile my AX C# project from the AOT, I get the following error:

MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Microsoft.Dynamics.AX.ManagedInterop", "x86". This mismatch may cause runtime failures. Please consider changing

It seems the cause is the ManagedInterop assembly is 32-bit but my project platform target is set to 'Any CPU'. If I change my project to x86, then the warning goes away, but my .NET code will not work when called from the server (which is 64-bit), so I think it is correct the way it is.

This is only a minor annoyance, but it would be nice if there was some way to suppress this specific warning completely. I've searched online but most solutions say to change the platform target. If someone knows another way, please let me know.

*This post is locked for comments

I have the same question (0)
  • Nayyar Siddiqi Profile Picture
    259 on at
    RE: MSB3270 version mismatch warning

    Nehal,

    Did you managed to resolve this issue ? I am having the same problem !

  • Nehal Mistry Profile Picture
    on at
    RE: MSB3270 version mismatch warning

    Nayyar,

    Unfortunately I have not resolved this. I'm sure there is a way but I can't be bothered to spend time on it. After a while you will get used to it and learn to ignore it completely.

  • Nayyar Siddiqi Profile Picture
    259 on at
    RE: MSB3270 version mismatch warning

    Thanks for the reply nehal :) but in my case its a bit hard to ignore.

    Actually I have created a solution added it to AOT and then deployed it, but the class I am trying to access from c sharp code is not available.. so I thought may be this warning has something to do with it.

  • Community Member Profile Picture
    on at
    RE: MSB3270 version mismatch warning

    I have the same issue. A "solution" to get rif of it is to change the build target architecture in VS to "Any CPU". But then it creates  another problem: when you run the code from AX it says the DLL coudn't be loaded (BadImage or something, sorry don't have the exact error message here).

    Another trick I tried is to add this code to the XML source file of the VS project definition (.csproj file) above Property groups:

    <PropertyGroup>

     <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>

       None

     </ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>

    </PropertyGroup>

    But it looks like AX is overwriting this file at some point and removes this code.

    So I don't really have a solution for now...

  • Community Member Profile Picture
    on at
    RE: MSB3270 version mismatch warning

    Same problem on my side here :-)

    - I've created a VS project with a service reference for a SOAP Service.

    - The Target platform is set to AnyCPU

    - I need the code to be executed on Server side on AX2012 R3 CU8.

    - The problem is that in case I set to AnyCPU when compiling from AX AOT the warning MSB3270 will be shown.

    - In case setting it to x86 the compiler issue disappears.

    - In both situations a runtime error occurs:

    Assembly containing type XXXXXX is not referenced.

    Object 'CLRObject' could not be created

    Did someone understand how to proceed?

    I've read the article dynamicsuser.net/.../68935.aspx but didn't find a solution for it.

    Was someone here successfull?

  • PA-22040759-0 Profile Picture
    6,194 on at
    RE: MSB3270 version mismatch warning

    Hi Guys,

    That annoys me too. I like a clean compilation log.

    It doesn't really matter and as you point out, the code won't run on the AOS tier if you change it.

    I have learned to live with it :-)

  • Community Member Profile Picture
    on at
    RE: MSB3270 version mismatch warning

    Hi All,

    I got the same waning, Please response any one got solutions 

  • PA-22040759-0 Profile Picture
    6,194 on at
    RE: MSB3270 version mismatch warning

    Check above.

    It doesn't really matter for the code to run from AX. And if you change the compilation settings, you won't be able to execute the code if called from the AOS:

  • MukeshHirwani Profile Picture
    1,180 on at
    RE: MSB3270 version mismatch warning

    Hi,

    Open your project in Visual Studio. Go to project properties, Switch to Build tab and change the Platform target to x86. Save project to AOT and deploy to server and client.

    After this restart you AX client and then compile your VS project.

    This will resolve the issue.

  • Nehal Mistry Profile Picture
    on at
    RE: MSB3270 version mismatch warning

    Mukesh,

    As I have mentioned in the original posting, this is not a solution. The platform target cannot be x86 otherwise the code will not run on the AOS. It must be Any CPU.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Guy Terry Profile Picture

Guy Terry 2 Moderator

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans