Visual Studio remote Linux project compilation results in error MSB4044 despite the valid connection

Viewed 905

I have a project (on Windows) that needs to be compiled remotely on Linux. It used to work some time ago (and address is valid, because it connects), but now I'm getting following error:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Application Type\Linux\1.0\Linux.targets(190,5): error MSB4044: The "ValidateValidArchitecture" task was not given a value for the required parameter "RemoteTarget".

When I double click that error it opens Linux.targets file at following section:

<Target Name="_ValidateValidArchitecture" DependsOnTargets="_ResolveRemoteDebuggingTarget;_RequiresRemoteConnection">
    <ValidateValidArchitecture Condition="'$(ValidateArchitecture)' != 'False' and '$(RequireRemoteConnection)' == 'true'"
      Platform="$(Platform)"
      RemoteTarget="$(ResolvedRemoteDebuggingTarget)"
      FailOnInvalidArchitecture="false"
      ProjectDir="$(ProjectDir)"
      RemoteProjectDir="$(RemoteProjectDir)"
      IntermediateDir="$(IntDir)"/>
</Target>

I couldn't find solution in Microsoft documentation. Has anyone encountered such a problem?

1 Answers

This problem can arise if you delete remote target machine, add it again and try to build the project immediately. The solution, at least for me, was to go to Project properties -> General -> Remote Build Machine and make sure that in there is only the IP address of your Linux machine, not some random numbers.

enter image description here

Related