none
Building a UWP sln via MSBuild builds every architecture possible for a dependent project. RRS feed

  • Question

  • I have a VS solution that I am trying to build via MSBuild on the command line.  This solution has a few dependencies in it.  Like this:

    Foo.sln

      Foo.csproj

      Foo.test.csproj

      Foo.logic.csproj

    When I build the solution via VS 2017, targeting x64 architecture it builds only the x64 binaries for Foo.test.csproj.  When I do basically the exact same thing via MSBuild it ends up building all the possible architectures that are configured for Foo.test.csproj (ARM, x64, and x86).  

    It seems like how this works is different in VS vs MSBuild, but I cannot for the life of me figure out the difference.  The build command I am running via MSBuild is:  

     C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\amd64\MSBuild.exe C:\Users\source\foo-uwp-app\src\uwp\foo.sln /target:Restore;Rebuild /verbosity:normal /toolsversion:15.0 /nologo /maxcpucount /property:Platform=x64 /property:Configuration=Debug


    Tuesday, July 16, 2019 6:05 PM

All replies

  • Hi ,

    Since the problem is more related to MSBuild, I'll help you to move this thread to the MSBuild Forum. You could get more professional support about MSBuild.

    Thank you for your patience.

    Best regards,

    Roy

     


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, July 17, 2019 2:56 AM
  • Hi Geoff,

    Welcome to MSDN forum.

    Sorry but I can't reproduce same issue in my machine. All works well and output same result when i build the solution in VS or msbuild command-line. According to your description, please follow these steps to trouble-shooting:

    1. If you create a new UWP test project in a new solution, what's the result if you build it in command-line, still build in ARM,x64,x86 platform when you specify it x64?

    2. Right-click your current solution in Solution Explorer to check Configuration Manager settings. When you select the Debug and x64 for Solution's configuration and platform, what's the value of Foo.Test project's platform? Is it x64?

    3. It seems you use the msbuild.exe from amd64 folder. Please try using the one from C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe . Check if it makes a difference cause you want to build them in x64. 

    4. Check the dependencies about Foo.Test project. Does this project only depend on Foo project or other project depends on it? And you can compare the results when build the Foo.Test project instead of whole solution to check what could be the cause of the issue.

    5. Check the content of Foo.Test.csproj, if you have done any changes for Debug|x64 PropertyGroup? It could be better if you can share the content of your Foo.Test.csproj file, so that we can check it more directly. Or if this issue persists in new solution's simple project, you can share a simple sample(deleting core code and personal data) which reproduces this issue then we can research it for you.

    Since this issue can't be reproduced in our side. And this build behavior is quite strange, we may have to do some trouble-shooting before we locate the issue. Thanks for your understanding!

    Any update about this issue feel free to contact us here.

    Best Regards
    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Wednesday, July 17, 2019 10:41 AM
  • Hi Geoff Goss,

    Sorry for bothering you. 

    As lance's suggestion, you could check if there still are differences in new project.

    Also please check if the the related configuration which is in command line is same with which in VS IDE.

    1. maxcpucount -> maximum number of parallel project builds (the default value is 2 in my IDE, and your sample is 3)

    2. verbosity ->  MSBUILD project build output verbosity (the default selection is minimal in my IDE)

    Note: Tools -> Options -> Project and Solutions -> Build and Run

    If possible, could you provide build logs as image or code here, which will help us analysis it better?

    Any feedback will be expected.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Monday, August 5, 2019 8:57 AM