error MSB4044: The "ValidateValidArchitecture" task was not given a value for the required parameter "RemoteTarget"
이런 오류가 발생한다면?
_ValidateCompatibleRemoteArchitectures:
Validating architecture
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Application Type\Linux\1.0\Linux.targets(203,5): error MSB4044: The "ValidateValidArchitecture" task was not given a value for the required parameter "RemoteTarget". [C:\temp\ConsoleApp1.vcxproj]
Done Building Project "C:\temp\ConsoleApp1.vcxproj" (Rebuild target(s)) -- FAILED.
Build FAILED.
"C:\temp\ConsoleApp1.vcxproj" (Rebuild target) (1) ->
(_ValidateValidArchitecture target) ->
C:\...[생략]...\Linux.targets(203,5): error MSB4044: The "ValidateValidArchitecture" task was not given a value for the required parameter "RemoteTarget". [C:\temp\ConsoleApp1.vcxproj]
명령행 또는 vcxproj에 포함한
RemoteTarget 속성이 올바른 원격 PC를 가리키지 않아서 그런 것입니다. 예를 들어 빌드 명령어에서,
c:\temp> msbuild "C:\temp\ConsoleApp1.vcxproj" /p:RemoteTarget=1144067422 /p:Platform=ARM64;Configuration=Release; /t:Rebuild
위와 같이 지정했다면 1144067422에 해당하는 원격 PC가 등록돼 있어야 합니다.
c:\temp> ConnectionManager.exe list
Reading stored connections from '%USERPROFILE%\AppData\Local\Microsoft\Linux\User Data\3.0\store.xml'
Connection ID | Host | Username | Port | Authentication Type
-----------------------------------------------------------------------
-1204116193 | 192.168.100.50 | testp | 22 | Password
위의 환경에서는 "-1204116193" ID에 해당하는 것만 있는 건데요, 따라서 원하는 빌드 서버를 우선 등록해 줘야 합니다.
c:\temp> ConnectionManager.exe add testp@192.168.100.51 --port 22 --privatekey "%USERPROFILE%\.ssh\test_ec"
...[생략]...
Successfully added connection '1252706199;192.168.100.51 (username=testp, port=22, authentication=PrivateKey)'.
(등록 이후에만 확인할 수 있는) 저 번호를 새롭게 RemoteTarget의 인자로 전달하면 빌드가 성공적으로 될 것입니다.
c:\temp> msbuild "C:\temp\ConsoleApp1.vcxproj" /p:RemoteTarget=1252706199 /p:Platform=ARM64;Configuration=Release; /t:Rebuild
[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]