none
Why do my project properties disallow a unified target platform selection?

    Question



  • Note: previous related travails are detailed here: http://stackoverflow.com/questions/18453917/why-am-i-getting-type-jro-jetengine-is-not-defined

    I'm working on a legacy VB.Net app. If I stand in a certain position (on one leg, a la Ian Anderson, with right elbow akimbo and spasmodically flapping, a la Joe Morgan in his heydey at the plate) and breathe in LaMaze-like regularity, it will compile, but only grudgingly, as it furrows its brow and warns me:

    *There was a mismatch between the processor architecture of the project being built "AMD64" and the processor architecture of the reference "Interop.JRO", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.*

    It had also been warning me, "*Possible problem detected while building assembly 'HDP': Referenced assembly 'JRO.dll' targets a different processor" but I squarshed that via Project > HDP Properties > Compile > Advanced Compile Options... > Target CPU > x86."*

    On the project properties page, the Platform dropdown does not contian "x86" as an option. As mentioned, I can set it via the  Advanced Compile Options... button, but now the page (Configuration > Platform) still says, "Active (x64)" (no x86 , only "Active (x64)", "Any CPU", "x64" and "All Platforms" are available).

    So I have a mismatch between what the Compile page says, and what the "Advanced Compiler Settings" page says.

    Why can't I just set it in one place, and have that value cascade through the project? For that matter, why doesn't Visual Studio guess which setting is best, based on DLLs in use, etc. (with the option to override its edumicated guess)?
    • Edited by B. Clay Shannon Tuesday, August 27, 2013 6:02 PM I don't need no stinkin' reason!
    Tuesday, August 27, 2013 6:01 PM

Answers

  • Hi Shannon,

    The different platforms for projects have different requirements, I think you could get more useful information from these two cases about “Solution Platforms” and “project platforms”.

    http://social.msdn.microsoft.com/Forums/en-US/5ad0ff2c-558c-43ba-a59d-9cd0a0785103/any-cpu-vs-x86-vs-x64-solution-platforms

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/06877ee7-ebaa-4683-9de1-5f6c676e19a3/project-setting-cpu-x86-x64-any-cpu

    As our discussion about the previous issue, if you couldn’t add a new project platform(x86) for your project, maybe you could create a simple web app, check it again. If all projects have the same issue, I suggest you re-install your VS2010, check it again. I’m not very sure whether it is related to your version, I just repro this issue in VS2010 ultimate version with VS2010 sp1, it works well for a simple web app. But if just a specific solution/project has this issue, maybe you could share me a simple sample, I will debug it in my side.

    Since I can’t reproduce this scenario on my machine. If it is urgent issue, I also suggest you to contact a Professional Support Service at http://support.microsoft.com/common/international.aspx?RDPATH=gp;en-us;offerprophone to gain more support on this case.

    If there's any concern, please feel free to let me know.

    Best Regards,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 09, 2013 3:18 AM
    Moderator
  • Hi Shannon,

    Glad to receive your reply:)

    Actually the previous issue which we discussed is that select the platforms x86, you could select the platforms "x86" now, am I right?

    The new issue you get it that you want to change all projects platforms automatically after the solution platforms change. Am I right?

    It seems that it is by design, it doesn’t work in VS2010 IDE. I mean that if we change the solution platforms, all projects platforms would not be changed. Not the real development expert, but I met some questions which are related to the platforms options, some specific app would require the specific platform x86/x64/Any CPU. If so, we would set different projects’ platforms. If we change all projects to have the same platform option if it could change all them with solution platforms, as the above sample, we would change some specific projects’ platforms manually.

    But I also check it in the VS2012 version, it works well, if I change the “Active solution platform”, all projects’ platforms would be changed.

    Best Regards,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Thursday, September 05, 2013 2:15 AM
    Moderator

All replies

  • I see I have a similar err msg in my asp.net app, too:

    There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Project\sscs\TLog\Development\Development\TLD\TLDCommonLib\bin\Debug\TLDCommonLib.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

    I reiterate: I think Visual Studio should keep these things in alignment - at least pop up a dialog explaining the issue and offering to fix it (perhaps with several different options).
    Tuesday, August 27, 2013 7:24 PM
  • Hi Shannon,

    Thank you for posting in the MSDN forum.

    There was a mismatch between the processor architecture of the project being built "AMD64" and the processor architecture of the reference "Interop.JRO", "x86"…

    I just did some research about the above error message, generally it will be related to the Target set.

    Just to make this issue clearly, which VS version are you using, VS2012 or VS2013 preview or others?

    Since this forum is to discuss the VS usage issue, to make sure that it is not the VS IDE issue, if you create a simple VB app, for example, a simple VB console app, and then check the properties of the project, could you get the X86 option like the following screen shot?

    If all apps don't have this option, if possible, one idea is that you could try to add the TargetPlatform for it like the following connect report, check it again.  

    http://connect.microsoft.com/VisualStudio/feedback/details/728995/new-vs2010-project-compiler-warning-since-installing-dotnet4-5-vs2011-beta

    If still no help, maybe you could repair your VS, please install the specific Service Pack for your specific VS version, for example, VS2010 sp1, or VS2012 update 3.

    But if the specific app has this issue, I’m afraid that it is not the VS IDE issue, since it is the VB app, if possible, you could post this issue to the VB development forum for better support.

    If there's any concern, please feel free to let me know.

    Best Regards,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, August 28, 2013 11:58 AM
    Moderator
  • This is VS 2010
    Wednesday, August 28, 2013 3:52 PM
  • Hi Shannon,

    Glad to receive your reply.

    In VS2010, I could get it under Compile->Advanced Compile Options…->Advanced Compiler Settings if I create a simple VB app, and then I could get the option like the following screen shot. So if possible, you could check it as my previous reply, check whether it is related to your VS IDE or the specific project.

    Reference:

    http://msdn.microsoft.com/en-us/library/vstudio/07bysfz2(v=vs.100).aspx

    Best Regards,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, August 29, 2013 2:03 AM
    Moderator
  • Thanks, Jack.

    What's confusing me is that I can select "x86" as you do above from that spot, but in the main portion of that page, the dropdown does NOT offer x86 as an option. So it at least LOOKS LIKE there is a mismatch within the project of what it is targeting.

    Thursday, August 29, 2013 3:55 PM
  • Hi Shannon,

    Glad to receive your reply.

    What's confusing me is that I can select "x86" as you do above from that spot, but in the main portion of that page, the dropdown does NOT offer x86 as an option.

    Maybe I misunderstood this issue, just to make this issue clearly, do you mean that you don’t get the option “X86” under Build->Configuration Manager like the following screen shot?

    If so, you could click “<New…>” under the platform dropdown, and then add the specific x86 platform like this screen shot.

    Reference:

    http://msdn.microsoft.com/en-us/library/vstudio/ms185328.aspx

    If I have misunderstood anything, please make free feel to let me know.

    Best Regards,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, August 30, 2013 2:09 AM
    Moderator
  • I do not have a Compile tab with my VS 2010 ASP.NET project. You show in your scream shot:

    Application
    Compile
    Debug
    References
    Resources
    Services
    Settings
    Signing
    My Extensions
    Security
    Publish
    Code Analysis

    ...whereas my project has:

    Application
    Build
    Web
    Package/Publish SQL
    Silverlight Applications
    Build Events
    Resources
    Settings
    References Paths
    Signing

    IOW, our tabs are almost completely different!
    Tuesday, September 03, 2013 4:00 PM
  • As noted above, I have no "Compile" tab.
    Tuesday, September 03, 2013 4:01 PM
  • My project's Build page looks like this:


    Tuesday, September 03, 2013 4:04 PM
  • Hi Shannon,

    Actually I just create a console app in my previous reply, for web apps, it is the same settings as yours.

    Like my previous reply, please open the Configuration Manager under Build menu, and then add the new x86 platform, and then you would get it like the following screen shot.

    Best Regards,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, September 04, 2013 2:00 AM
    Moderator
  • What I get when I select Build > Configuration Manager is:

    Active solution configuration: Debug
    Active solution platforms: Mixed Platforms

    If I change Active solution platforms to x86 (selecting it from the dropdown), I still have a mixture of Platforms in the projects listed in the grid (several x86, but mostly "Any CPU"). 

    I'm afraid to change any of them, because my responsibility, at present anyway, is for only one of the projects, and I don't want to break the tenuous balance/connection within or between a project or projects.

    All projects with "x86" as their Platform have the Build checkbox ticked; none of the "Any CPU" do.

    So, I am still in a situation where I would like the entire solution to be uniform as to platform, and I don't know if the current mixing-and-matching is tolerable or terrible.
    Wednesday, September 04, 2013 3:21 PM
  • Hi Shannon,

    Glad to receive your reply:)

    Actually the previous issue which we discussed is that select the platforms x86, you could select the platforms "x86" now, am I right?

    The new issue you get it that you want to change all projects platforms automatically after the solution platforms change. Am I right?

    It seems that it is by design, it doesn’t work in VS2010 IDE. I mean that if we change the solution platforms, all projects platforms would not be changed. Not the real development expert, but I met some questions which are related to the platforms options, some specific app would require the specific platform x86/x64/Any CPU. If so, we would set different projects’ platforms. If we change all projects to have the same platform option if it could change all them with solution platforms, as the above sample, we would change some specific projects’ platforms manually.

    But I also check it in the VS2012 version, it works well, if I change the “Active solution platform”, all projects’ platforms would be changed.

    Best Regards,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Thursday, September 05, 2013 2:15 AM
    Moderator
  • Thanks, Zhai.

    As to your question, "...you could select the platforms "x86" now, am I right?":

    No, I still only have one option when I select Project | <projectName>Properties | Build in the Platform dropdown, namely "Active (Any CPU)"

    However, I'm glad that as of VS2012 (which I use at home, still stuck with VS2003 and VS2010 at work), it works more the way I would expect/want.

    Thursday, September 05, 2013 3:47 PM
  • Hi Shannon,

    I still only have one option when I select Project | <projectName>Properties | Build in the Platform dropdown, namely "Active (Any CPU)"

    As far as I know, it is the default settings, if we want to get the option “X86”. We would add the new project platform like this screen shot. It works well in my side.

    About the second issue, if possible, I suggest you use the VS2012, since you would get more better features.

    Best Regards,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, September 06, 2013 1:29 AM
    Moderator
  • "It works well in my side."

    Ow, that sounds painful; that's taking embedded programming too far.

    Using VS2012 at work is not an option at this time.

    I can set projects to "x86"; it's the non-homogeneous nature of the projects in this solution that's bothering me. I guess my "problem" (of having some projects that are set to "Any CPU" and others to "x86") is not necessarily really a problem; it just seems odd to me. Maybe the problem is that I don't understand what it all means - what impact will it have on users depending on which platform the project is set to...

    Anyway, thanks for your help, Jack!
    Friday, September 06, 2013 3:44 PM
  • Hi Shannon,

    The different platforms for projects have different requirements, I think you could get more useful information from these two cases about “Solution Platforms” and “project platforms”.

    http://social.msdn.microsoft.com/Forums/en-US/5ad0ff2c-558c-43ba-a59d-9cd0a0785103/any-cpu-vs-x86-vs-x64-solution-platforms

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/06877ee7-ebaa-4683-9de1-5f6c676e19a3/project-setting-cpu-x86-x64-any-cpu

    As our discussion about the previous issue, if you couldn’t add a new project platform(x86) for your project, maybe you could create a simple web app, check it again. If all projects have the same issue, I suggest you re-install your VS2010, check it again. I’m not very sure whether it is related to your version, I just repro this issue in VS2010 ultimate version with VS2010 sp1, it works well for a simple web app. But if just a specific solution/project has this issue, maybe you could share me a simple sample, I will debug it in my side.

    Since I can’t reproduce this scenario on my machine. If it is urgent issue, I also suggest you to contact a Professional Support Service at http://support.microsoft.com/common/international.aspx?RDPATH=gp;en-us;offerprophone to gain more support on this case.

    If there's any concern, please feel free to let me know.

    Best Regards,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 09, 2013 3:18 AM
    Moderator
  • Thanks, Jack; I know it's not your fault, but MS really needs to fix the layout of their forums - it's very frustrating trying to find what the latest update to a discussion is; the individual responses seem to be all jumbled and mixed up. It needs to be more like, if not exactly like, Stack Overflow.
    Friday, September 13, 2013 3:26 PM
  • Hi Shannon,

    If you have good suggestions, you could submit it here: http://visualstudio.uservoice.com/forums/121579-visual-studio. The Visual Studio product team is listening to user voice there. You can send your idea/suggestion there and people can vote.

    Have a nice day,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 16, 2013 1:28 AM
    Moderator