[英]“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 片段
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 模板现在这有点棘手,但请耐心等待
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}部分)
Finally!! 最后!! To finish this off you have to tell VS Phone Express to actually install the templates
要完成此操作,您必须告诉VS Phone Express实际安装模板
"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.