简体   繁体   English

“添加新项”选项中未显示“ Windows 7 Phone的Silverlight”选项

[英]“silverlight for Windows 7 Phone” option is not shown in “Add new Item” option

I have downloaded and installed Microsoft Visual Studio 2010 Express for Windows 7 Phone. 我已经下载并安装了适用于Windows 7 Phone的Microsoft Visual Studio 2010 Express。 Problem is that i cant see "Silverlight for Windows Phone" option when I right click my Project name and select Add -> New Item option. 问题是当我右键单击项目名称并选择添加->新建项目选项时,我看不到“用于Windows Phone的Silverlight”选项。 I can only see "XNA Game Studio 4.0" under "Visual C#" category. 我只能在“ Visual C#”类别下看到“ XNA Game Studio 4.0”。 I have tried installing Silverlight SDK separately by downloading it from Microsoft site but the installer tells me that i have already installed the newer version of the SDK. 我尝试通过从Microsoft网站下载单独安装Silverlight SDK的方法,但安装程序告诉我我已经安装了较新版本的SDK。 Due to this problem I can't use few Silverlight classes like ChildWindow etc. 由于这个问题,我不能使用像ChildWindow等这样的Silverlight类。

Can anyone please help me in this regard? 有人可以在这方面帮助我吗?

I personally haven't had problems with the WP tools install, but I have witnessed others having problems. 我个人没有安装WP工具的问题,但是我目睹了其他人的问题。 The only advice I can give is to uninstall all the tools, sdk, etc and reinstall with the latest. 我能提供的唯一建议是卸载所有工具,SDK等,然后重新安装最新版本。

It's a pain, but might be necessary unless someone has a better idea. 这很痛苦,但除非有人有更好的主意,否则可能是必要的。

The instructions at http://msdn.microsoft.com/en-us/library/ff402526(v=VS.92).aspx say http://msdn.microsoft.com/zh-cn/library/ff402526(v=VS.92).aspx上的说明说

Make sure you have downloaded and installed the Windows Phone Developer Tools from the App Hub. 确保已从App Hub下载并安装了Windows Phone开发人员工具。

So my advice is to make sure you've done that. 因此,我的建议是确保您已完成该操作。

Right having just struggled with this myself I finally found an answer. 我自己为此苦苦挣扎,终于找到了答案。 If you have a Full version of Visual Studio installed it will not install the templates to the Phone version of C# express (turns out it is actually a different executable to the standard C# Express, go figure) 如果您安装了Visual Studio的完整版,则不会将模板安装到C#Express的电话版中(原来它实际上是与标准C#Express不同的可执行文件,请参见图)。

So to resolve this you need to do a couple of things: 因此,要解决此问题,您需要做几件事:

Snippets 片段

  • First, add the path to the Snippets in the snippet Manager using "Tools -> Code Snippets Manager" 首先,使用“工具->代码段管理器”在代码段管理器中添加代码段的路径
  • Click on "Add" and enter the following Path: 点击“添加”并输入以下路径:

C:\\Program Files (x86)\\Laurent Bugnion (GalaSoft)\\Mvvm Light Toolkit\\Snippets\\CSharp\\ C:\\ Program Files(x86)\\ Laurent Bugnion(GalaSoft)\\ Mvvm Light Toolkit \\ Snippets \\ CSharp \\

(Note ignore the (x86) if you are on a 32bit system) This will install the installed snippets into VS Express. (如果您使用的是32位系统,请注意(x86)。)这会将已安装的代码片段安装到VS Express中。

Templates Now this is a little more tricky but bear with me 模板现在这有点棘手,但请耐心等待

  • Copy the MVVM folder from: 从以下位置复制MVVM文件夹:

C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\ProjectTemplates\\CSharp\\Silverlight\\ C:\\ Program Files(x86)\\ Microsoft Visual Studio 10.0 \\ Common7 \\ IDE \\ ProjectTemplates \\ CSharp \\ Silverlight \\

To

{Documents Folder}\\Visual Studio 2010\\Templates\\ProjectTemplates\\Visual C#\\ {Documents Folder} \\ Visual Studio 2010 \\ Templates \\ ProjectTemplates \\ Visual C#\\

(Replacing the {Documents Folder} section with your My Documents folder) (用我的文档文件夹替换{Documents Folder}部分)

  • Repeat the above replacing ProjectTemplates with ItemTemplates 重复上述将ItemTemplates替换为ItemTemplates

Finally!! 最后!! To finish this off you have to tell VS Phone Express to actually install the templates 要完成此操作,您必须告诉VS Phone Express实际安装模板

  • Run a Command Prompt with administrative privileges (either create a command line short-cut on the desktop and right-click run it with admin privileges or use the VS tools command prompt) 以管理特权运行命令提示符(在桌面上创建命令行快捷方式,然后右键单击以管理特权运行命令提示符,或使用VS tools命令提示符)
  • Run the Following command in that window 在该窗口中运行以下命令

"c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\VPDExpress.exe" /installvstemplates “ c:\\ Program Files(x86)\\ Microsoft Visual Studio 10.0 \\ Common7 \\ IDE \\ VPDExpress.exe” / installvstemplates

(Note ignore the (x86) if you are on a 32bit system) If all goes well you should see nothing happen :D, but if you run VS Express for Windows Phone now you will have the new templates installed and the item templates plus the all useful code snippets (注意,如果您使用的是32位系统,请忽略(x86))。如果一切顺利,您应该什么都不会发生:D,但是如果您运行VS Express for Windows Phone,现在将安装新模板,项目模板以及所有有用的代码片段

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Windows中添加右键单击选项 - Add a right click option in windows 在Windows Phone 8中共享图库中的任何图片时,在共享选项列表中添加应用程序图标 - Add App icon in share option list when share any picture from gallery in windows phone 8 如何在新兴的菜单窗口中添加自己的选项? - How to add own option to emerging menu windows? 通过右键单击选项中的“新建文件/文件夹”选项更改/添加/删除项目(Windows 7-8)? - Change/Add/Remove items from the New File/Folder option in the right click options (Windows 7-8)? XNA和Windows Phone 8.1的Silverlight - XNA and Silverlight for Windows Phone 8.1 SwitchTothread Windows的Linux选项 - Linux Option of SwitchTothread Windows Windows 8中的指纹验证选项 - FingerPrint Authentication option in Windows 8 Windows 7 IIS管理器缺少“添加角色和功能”选项 - Windows 7 IIS Manager missing “Add Roles and Features” option 我的IIS 10.0中没有Windows身份验证选项,我该如何添加它? - There is no Windows authentication option in my IIS 10.0, how can i add it? 如何在上下文菜单中添加“新建”Python脚本选项? - How do I add a “New” Python script option to the context menu?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM