none
Target Platform Options in VS Express 2013 Desktop

    Question

  • I am using VS Express 2013 Desktop to build a WinForms app in C#.  While exploring what it takes to incorporate SQLite, I came across suggestions for setting the Target Platform in the Build tab of the project's Properties window.  The recommendation and apparently new default is to use Any CPU with Prefer 32-bit.  Problem is, Prefer 32-bit is grayed out in my project, regardless of what I choose for CPU. 

    In case it's relevant, I am currently using SQL CE as the DBMS and MS Office Interop to Excel dll.  Somehow I also have a VBIDE reference in my project.

    Any idea what the deal is?  Thanks.  Steve

    P.S. Just installed VS Community 2015 and am seeing the same problem...can't set Any CPU with Prefer 32-bit in this Solution.




    • Edited by Cincy Steve Saturday, April 09, 2016 7:42 PM
    Friday, April 08, 2016 5:36 PM

Answers

  • Hi Steve,

    I think the problem of this issue is that your application is developed based on .NET 3.5 or 4.0.

    And the "Prefer 32-bit" checkbox is only enabled for .NET 4.5+ executable projects.

    I also create a new project which is based on .Net 3.5 and "Prefer 32-bit" checkbox is grey out.

    So I think the problem is related to the .NET framework when you created you app. You could try to change the .net framework of your project then try it again.(Right click your project->Application->Change .net framework to 4.5)

    Best Regards,

    Lake Xiao

    • Marked as answer by Cincy Steve Tuesday, April 12, 2016 11:58 AM
    Tuesday, April 12, 2016 5:08 AM
    Moderator

All replies

  • Hi Steve,

    Thanks for your post.

    Could you pelase where did you create your project? And How about creating a new Windows c# windows form app?

    >>Prefer 32-bit is grayed out in my project, regardless of what I choose for CPU. 

    I did a test in my side using VS2013 Community Update5 and VS2015 Community, they both works well.

    1. If the Prefer 32-bit is grayed out  for the new created windows form application. I think the problem is in your VS, try to repair it or isntall the latest update of Visual Studio.

    2. If the problem only occured for the specified project. In this case, i think the cause is more realted to the project itself.

    Please create a new project and copy code into it then try it agian.

    Best Regards,

    Lake Xiao

    Monday, April 11, 2016 1:21 AM
    Moderator
  • Lake -  I installed Community 2015 yesterday and did the test you suggested.  It worked fine, but the old app under Community 2015 still doesn't.  So, the problem is in the app.  It was first written with VS 2008 Express and most recently 2013 Express.  It has an embedded SQL CE database and is targeted to .Net 4.5.1.

    Before posting my question, I removed an unused 3rd party dll that I thought might be restricted to x86, but that didn't fix the problem.  Do you know how to tell what components of the app could be restricting it to x86, or at least know things I should investigate?

    Thanks.  Steve


    Monday, April 11, 2016 3:24 AM
  • Hi Steve,

    >>It was first written with VS 2008 Express and most recently 2013 Express.

    Since the app was developed in VS2008 and VS2013. And for your problem, I think the cause is that the app is not compatible with VS2015.

    Please create a new windows form application then copy the code from your app to the new created app then try it again.

    If still has the problem, if possible, please provide us the detailed code or your project so that we could better troubleshoot it.

    Best Regards,

    Lake Xiao

    Monday, April 11, 2016 6:47 AM
    Moderator
  • Lake - Copying the program will be somewhat time consuming because it's large (20 folders of code plus several SqlCE databases and some other items) and I don't know how to do a mass copy that VS will recognize as part of the new app.  So, before I take that step, I'd like to explore other possible ways to diagnose and solve the problem.

    I have discovered 2 things in the last few minutes:

    1.  The Solution level Platform Property was set to 'Active(Mixed Platforms)', so I changed that to 'Any CPU'.  That didn't fix the Project level Target Platform problem.

    2.  I have a compiler warning that says "Unable to apply publish properties for item 'xxx'", where xxx is the name of an old SqlCE database that I was at one point deploying with the app.  I removed that database from the app quite awhile ago.  I've just looked for remnants of it in the various config and settings files as well as doing a Quick Find across the entire Solution, but don't see any references to it.  Obviously there is one somewhere (in order to generate the warning).  Any idea how I might get rid of this warning before taking the tedious step of copying all the files into a new app?

    Thanks for your patience and help.  Steve

     
    Monday, April 11, 2016 2:12 PM
  • Hi Steve,

    I think the problem of this issue is that your application is developed based on .NET 3.5 or 4.0.

    And the "Prefer 32-bit" checkbox is only enabled for .NET 4.5+ executable projects.

    I also create a new project which is based on .Net 3.5 and "Prefer 32-bit" checkbox is grey out.

    So I think the problem is related to the .NET framework when you created you app. You could try to change the .net framework of your project then try it again.(Right click your project->Application->Change .net framework to 4.5)

    Best Regards,

    Lake Xiao

    • Marked as answer by Cincy Steve Tuesday, April 12, 2016 11:58 AM
    Tuesday, April 12, 2016 5:08 AM
    Moderator
  • Lake - That's it!  Thanks for taking the time to solve this problem for me.  Steve
    Tuesday, April 12, 2016 11:57 AM