【发布时间】:2017-11-20 06:32:06
【问题描述】:
这周我不得不重新安装我的操作系统,我之前运行的代码在 Visual Studio 2015 中不再运行。(此后代码没有变化)
当我构建和部署代码时出现以下错误:
Severity Code Description Project File Line Suppression State
Error DEP3321 : To deploy this application, your deployment target should be running Windows Universal Runtime version 10.0.10586.0 or higher. You currently are running version 10.0.10240.17443. Please update your OS, or change your deployment target to a device with the appropriate version. HistAppV1
在谷歌上搜索后,this 文章在某种意义上有所帮助,所以当我卸载项目并更改行时
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
当我把它改成
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
我可以成功构建和部署我的应用程序,但它在初始屏幕上崩溃并出现此错误。
#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
UnhandledException += (sender, e) =>
{
if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
};
#endif
我也遇到了一个异常
GattServices error CS0103: The name 'GattServices' does not exist in the current context
我还没有发现任何明确的迹象表明 GattServices 是从哪个版本包含的,但我认为版本控制的更改会导致问题。我该如何解决这个问题?或者我怎样才能保留我的版本,或更新我的 VS 以获得适当的版本?
我正在使用 Visual Studio 2015 社区版,就像我之前的计算机安装一样。正如我提到的,操作系统是全新的重新安装,全新安装了 Visual Studio,所以我现在真的不知道现在出了什么问题。
【问题讨论】:
-
您安装的 windows 版本是旧版本,您需要通过 windows update 或使用 Microsoft 的媒体创建工具对其进行更新。 Gatt services api 在第一个版本中不可用,这就是 appi 崩溃的原因。
标签: c# visual-studio visual-studio-2015 uwp