使用Xamarin Mac代理

时间:2018-01-18 11:57:28

标签: xamarin xamarin.ios msbuild visual-studio-2017

我有Mac,可以通过路由器上的NATed端口6535从外部网络访问;路由器本身也暴露了端口22。我希望通过Xamarin Mac代理从外部网络连接到我的Mac。

我可以通过SSH(Putty)将它们连接到路由器和Mac,但是当我尝试从Visual Studio 2017(或MsBuild命令提示符)连接到Mac时输入Server IP,如1.1.1.1:6535(其中) 1.1.1.1由我的路由器外部IP代替 - 我通过指纹看到,Studio正在使用端口22进行连接(我看到我的路由器指纹,而不是我的Mac指纹)。

是否可以从Visual Studio中运行的Xamarin Mac代理和 MsBuild 连接到自定义端口?

Can the Xamarin Mac Agent's port be configured? (to something other than port 22) - 建议我需要先成功连接,但我不能。从机器导入注册表项,连接成功没有帮助,因为VS仍然试图通过指纹看到的端口22碰到远程主机(所以,我仍然无法从Visual Studio连接)。如果我尝试直接调用MsBuild - 它也会失败,因为MsBuild只是忽略了port指令。

我在提升的开发人员命令提示符下使用以下cmdline启动MsBuild:msbuild mySolution.sln /t:Clean;Build /p:Configuration="Release";IpaPackageDir=C:\t\;Platform=iPhone;ServerAddress=1.1.1.1;ServerPort=6535;ServerUser=user;ServerPassword=password

作为回应,我收到以下信息:

_SayHello:
  Connecting to Mac server 1.1.1.1...
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets(63,
5): warning : Ignoring server port when the build is not running inside Visual Studio. [myprojectpath\myproject.csproj]
  Starting connection to 1.1.1.1...

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets(63,
5): warning : Could not authenticate the user 'user' with the provided credentials [myprojectpath\myproject.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets(63,
5): warning VSX1000: A connection to the Mac Server couldn't be established with Address='1.1.1.1' and User='user', so only the main assembly was compiled for project 'myproject'. Connect to a Mac Server and try again to build
the full application. [myprojectpath\myproject.csproj]

1 个答案:

答案 0 :(得分:0)

请参阅以下主题,相信这对您有所帮助。

Configure xamarin Mac agent port to something other than 22

我已经标记了这一点,因为我认为它在大多数情况下是重复的。

跟进:在您的路由器配置中,您能否:

  1. 暂时将端口映射22分配给您的Mac并进行测试以确保其有效,然后您可以将其重新设置。
  2. 创建一个端口映射,将“路由器外部”(您的6 ***号码)指向“mac IP地址内部端口22”,如果您的路由器最像,您应该能够将此外部端口分配给Mac的端口22上的IP。
  3. 如果您遇到此问题,请提供上述路由器配置的屏幕截图,以便我们协助。

    此致

    编辑:添加额外信息

相关问题