Visual Studio 2015 C# XAML 设计器不加载
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29994558/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio 2015 C# XAML Designer doesn't load
提问by David Schmidlin
In the new Visual Studio 2015 RC the XAML designer does not bring up a UI for a C# Windows Universal project but it does for a C++ Windows Universal project. This occurs with both the Professional and Community editions. Has any one experience the same problem and have a workaround/solution?
在新的 Visual Studio 2015 RC 中,XAML 设计器不会为 C# Windows 通用项目提供 UI,但会为 C++ Windows 通用项目提供 UI。专业版和社区版都会发生这种情况。有没有人遇到同样的问题并有解决方法/解决方案?
采纳答案by Unni Ravindranathan
To help clarify this a bit -
为了帮助澄清这一点 -
If you are building a Universal Windows 10 application with Visual Studio 2015 running on Windows 8.1 - something that we have enabled for the first time without requiring your to upgrade your OS, you will not be offered the XAML designer option - we will only allow you to edit XAML using the editor and IntelliSense. Similarly, you will not be allowed to test the application locally or using the Simulator (since it is a Windows 10 application and cannot run on your machine). Everything else should work fine, but for the best experience possible, consider upgrading to Windows 10.
如果您正在使用在 Windows 8.1 上运行的 Visual Studio 2015 构建通用 Windows 10 应用程序——这是我们首次启用而无需您升级操作系统,您将不会获得 XAML 设计器选项——我们将只允许您使用编辑器和 IntelliSense 编辑 XAML。同样,您将无法在本地或使用模拟器测试应用程序(因为它是 Windows 10 应用程序,无法在您的计算机上运行)。其他一切都应该可以正常工作,但为了获得最佳体验,请考虑升级到 Windows 10。
If you are building a Windows 8.1 universal application, it should work just like before.
如果您正在构建 Windows 8.1 通用应用程序,它应该像以前一样工作。
回答by Vojtěch ?tursa
I installed fresh Windows 10 and Visual Studio Community 2015, and the designer failed to load (for MainPage.xaml etc). I had to:
我安装了全新的 Windows 10 和 Visual Studio Community 2015,但设计器无法加载(对于 MainPage.xaml 等)。我不得不:
- enable developer mode in system settings (update section) as suggested in info dialog
- (re)install Visual C++ redistributable for VS 2015
- 按照信息对话框中的建议在系统设置(更新部分)中启用开发人员模式
- (重新)安装适用于 VS 2015 的 Visual C++ 可再发行组件
But I don't know which one exactly resolved the problem... Now the designer loads as expected. (I tried only C# universal app yet)
但我不知道哪一个完全解决了问题......现在设计器按预期加载。(我只尝试了 C# 通用应用程序)
回答by Ivan
回答by user2960136
Windows 10 (fresh install + Developer mode) VS 2015 Update 1 Ultimate SDK Build 10586 By default no designer being available even via Shift-F7.
Windows 10(全新安装 + 开发人员模式)VS 2015 Update 1 Ultimate SDK Build 10586 默认情况下,即使通过 Shift-F7 也没有可用的设计器。
This expands the scope of the original problem, its not a VS edition based issue at all. Its a problem with the SDK support.
这扩大了原始问题的范围,它根本不是基于 VS 版本的问题。它是 SDK 支持的问题。
AS per Wener Henze
AS per Wener Henze
Swtich back to Build 10240. Fixed. Designer now available.
切换回 Build 10240。已修复。设计师现在可用。
Werners workaround is confirmed and saved me lots of time. I don't have the rep to thank him, or comment on his post directly.
Werners 的解决方法得到确认并为我节省了大量时间。我没有代表感谢他,也没有直接评论他的帖子。
回答by Dominic Zanardi
If the XAML designer is failing to open, check the "Flag" notifications in the top right corner. You might notice a message that your Windows 10 build needs to be updated.
如果 XAML 设计器无法打开,请检查右上角的“标记”通知。您可能会注意到一条消息,提示您的 Windows 10 版本需要更新。
1: 
1:
The target platform can't be newer than the Windows 10 build you're actually running.
目标平台不能比您实际运行的 Windows 10 版本更新。
回答by Max Go
In case if you have installed fresh Windows 10 Build 10240 and downloaded and installed latest Visual Studio 2015, target version 10240 is not available in Project Properties -> Application -> Target version and designer is not working too.
如果您安装了全新的 Windows 10 Build 10240 并下载并安装了最新的 Visual Studio 2015,则目标版本 10240 在项目属性 -> 应用程序 -> 目标版本中不可用,并且设计器也无法工作。
I have got Target version 10240 selection available after I've installed additionally Windows 10 RTM SDK from following page. As discussed above, designer works fine if Target version 10240 is selected.
在我从以下页面额外安装了 Windows 10 RTM SDK 后,我有可用的目标版本 10240 选择。如上所述,如果选择了 Target 版本 10240,设计器可以正常工作。
回答by Matthis Kohli
As an update to the answer of @Ivan because I just had to do with this issue recently.
作为对@Ivan 答案的更新,因为我最近刚刚处理了这个问题。
In my case I only had the option to change the Min Version from 10586 to 10240 but for the Target version I had no other choice than 10586. So solving this issue was not possible.
就我而言,我只能选择将 Min Version 从 10586 更改为 10240,但对于 Target 版本,我别无选择,只能选择 10586。因此无法解决此问题。
The solution was to install SDK Version 1506 (Version 10.0.26624.0) which can be found here https://developer.microsoft.com/de-de/windows/downloads/sdk-archive
解决方案是安装 SDK 版本 1506(版本 10.0.26624.0),可以在这里找到https://developer.microsoft.com/de-de/windows/downloads/sdk-archive
After a restart of Visual Studio I was able to switch the Target version as well @Ivan mentioned and the XAML designer finally showed up. Heureka!
重新启动 Visual Studio 后,我也可以切换 @Ivan 提到的 Target 版本,XAML 设计器终于出现了。赫里卡!
Thanks for the hint @Ivan.
感谢@Ivan 的提示。
回答by Helawe Behailu
you have to have the appropriate sdk installed on your machine, you can get it from the official site of Microsoft https://developer.microsoft.com/en-us/windows/downloads/sdk-archive
您必须在您的机器上安装适当的 sdk,您可以从 Microsoft 的官方网站https://developer.microsoft.com/en-us/windows/downloads/sdk-archive 获取
before that please remove the old sdk you installed on your pc, so that VS will use the new one.
在此之前,请删除您在 PC 上安装的旧 sdk,以便 VS 使用新的 sdk。
then it'll work... i fixed mine in this way.
然后它会起作用......我以这种方式修复了我的。

