GoogleCloudPlatform / google-cloud-visualstudio

Google Cloud Tools for Visual Studio
https://cloud.google.com/tools/visual-studio/docs/
Apache License 2.0
88 stars 51 forks source link

Deploying .Net to Compute defaults to x86? #1067

Closed NPSF3000 closed 5 years ago

NPSF3000 commented 5 years ago

Been using the VS tools plugin 2.0.0.0 to deploy code to GCP. Recently a project started failing to deploy, and it appears it's because the build command from GCP tools is defaulting to x86 instead of 'Any CPU'.

Editing my project fixed this for now:

FROM  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
TO     <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU' Or '$(Configuration)|$(Platform)' == 'Release|x86'">

Possible fixes: A) Default to AnyCPU B) Default to whatever the project is already selected as. C) Add a drop-down option in the deploy UI?

ILMTitan commented 5 years ago

The version 1.4.0 was explicitly stating a Platform of AnyCPU, while version 2.0.0 does not. I would be curious to see what part of the project file was setting the Platform to x86. I will have to consider if/how we change this again.

NPSF3000 commented 5 years ago

@ILMTitan I wish I knew. Did a grepWin on the project for x86 and wasn't able to figure out why it was defaulting to this.

ILMTitan commented 5 years ago

@NPSF3000

The solution I am currently considering is adding a new property GoogleComputeEngineBuild that I will set to True when running a build from the extension. You could then add the following code to your build file:

<PropertyGroup Condition="$(GoogleComputeEngineBuild) == 'True'">
    <Platform>AnyCPU</Platform>
</PropertyGroup>

Would that be sufficient for to fix your problem?