麻烦创建文件无头 - Raspberry PI 2和Windows 10 [英] Troubles creating a file Headless - Raspberry PI 2 and Windows 10
问题描述
我的目标是让一个无头程序在Windows 10 FileSystem上创建一个文件。
我的问题是当我在程序中有代码写入时FileSystem程序不会部署到Raspberry PI 2.  即使一切都编译得很好。
private async void FileStuff()
{
StorageFolder folder = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile sampleFile = await folder.CreateFileAsync(" sample.txt",CreationCollisionOption.OpenIfExists);
等待Windows.Storage.FileIO.WriteTextAsync(sampleFile,"Swift as a shadow");
}
Visual Studio将产生以下错误。
错误:无法连接到名为"192.168.100.104"的Microsoft Visual Studio远程调试器。 Visual Studio 2015远程调试程序(MSVSMON.EXE)似乎未在远程计算机上运行。这可能是因为防火墙阻止了与远程计算机的
通信。有关配置远程调试的帮助,请参阅"帮助"。
如果我注释掉FileStuff()方法(以及调用FileStuff()的行),那么应用程序将部署到Raspberry PI 2正如预期的那样。
您对尝试什么有什么建议吗?
我怀疑它必须使用async / await,但没有证据。
谢谢
我无法重现您的问题。我将RPi2设置为无头模式,并编写了一个包含代码的后台应用程序。该文件已成功写入。
您确定msvsmon.exe实际上正在您的设备上运行吗?您可以访问
http://< your 设备IP地址>并选择进程。
如果它没有运行,请尝试执行RegisterOneCoreRdbg.cmd,然后在c:\ RDBG中找到StartOneCoreRdbg.com
My goal is to get a headless program to create a file on the Windows 10 FileSystem.
My problem is is that when I have code in the program to write to the FileSystem the program will not deploy to the Raspberry PI 2. Even though everything compiles just fine.
private async void FileStuff() { StorageFolder folder = Windows.Storage.ApplicationData.Current.LocalFolder; StorageFile sampleFile = await folder.CreateFileAsync("sample.txt", CreationCollisionOption.OpenIfExists); await Windows.Storage.FileIO.WriteTextAsync(sampleFile, "Swift as a shadow"); }
Visual Studio will produce the following error.
Error: Unable to connect to the Microsoft Visual Studio Remote Debugger named '192.168.100.104'. The Visual Studio 2015 Remote Debugger (MSVSMON.EXE) does not appear to be running on the remote computer. This may be because a firewall is preventing communication to the remote computer. Please see Help for assistance on configuring remote debugging.
If I comment out the method FileStuff() (and the line that calls FileStuff()) then the application will deploy to the Raspberry PI 2 as expected.
Do you have any suggestions on what to try?
My suspicion is that it has to do with async/await, but have no proof.
Thanks
I am not able to reproduce your problem. I set my RPi2 into headless mode and wrote a background application that included your code. The file was written successfully.
Are you sure msvsmon.exe is actually running on your device? You can find out by going to http://<your Device IP Address> and selecting Processes.
If its not running try executing RegisterOneCoreRdbg.cmd and then StartOneCoreRdbg.com both found in c:\RDBG
这篇关于麻烦创建文件无头 - Raspberry PI 2和Windows 10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!