开发者

"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. Problem is that i cant see "Silverlight for Windows Phone" option when I right click my Project name and select Add -> New Item option. I can only see "XNA Game Studio 4.0" under "Visual C#" category. I have tried installing Silverlight SDK separately by downloading it from Microsoft site but the installer tells me that i have already installed the newe开发者_高级运维r version of the SDK. Due to this problem I can't use few Silverlight classes like ChildWindow etc.

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. The only advice I can give is to uninstall all the tools, sdk, etc and reinstall with the latest.

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

Make sure you have downloaded and installed the Windows Phone Developer Tools from the App Hub.

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)

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\

(Note ignore the (x86) if you are on a 32bit system) This will install the installed snippets into VS Express.

Templates Now this is a little more tricky but bear with me

  • Copy the MVVM folder from:

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

To

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

(Replacing the {Documents Folder} section with your My Documents folder)

  • Repeat the above replacing ProjectTemplates with ItemTemplates

Finally!! To finish this off you have to tell VS Phone Express to actually install the templates

  • 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)
  • Run the Following command in that window

"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

Hope this helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜