Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

Benign warning when creating a Silverlight and XNA Application project in the Windows Phone SDK 7.1

Benign warning when creating a Silverlight and XNA Application project in the Windows Phone SDK 7.1

Rate This
  • Comments 3

I have seen several people ask about this scenario on the App Hub forums, and I wanted to write a blog post to help raise visibility because it is hard to find in the release notes.

Description of the issue

The Windows Phone SDK 7.1 introduces the ability to create applications that combine Silverlight and XNA Framework technologies.  If you create a new Windows Phone Silverlight and XNA Application using the project template that ships with the Windows Phone SDK 7.1, you will see a warning like the following in the Visual Studio error window:

The project 'SlXnaApp1Lib' cannot be referenced.  The referenced project is targeted to a different framework family (.NETFramework)

This warning will not prevent you from building or running the Silverlight and XNA Application project, and you can safely ignore the warning.

More details about the root cause of the issue

A Silverlight and XNA Application includes a Silverlight project, an XNA Game Studio Windows Phone Game Library project and an XNA Game Studio content project.  The Silverlight project is the parent project, and it includes a project-to-project reference to the XNA game library project.  The warning occurs because Visual Studio detects that the XNA project does not target the same .NET Framework profile as the Silverlight project.  However, on Windows Phone, there is only one .NET Framework profile, regardless of what the target framework settings are in the project files, so the warning does not indicate any possible functional problems when you build and run your application.

  • It's in the release notes.  Sigh.  :)

  • Hi nkm - You're right, but from what I've seen on the forums, people are having a hard time finding it there and are asking about it anyways.

  • It's annoying that they don't just suppress this warning if they know it's harmless though.  I like my projects to be error-and-warning-free.

Page 1 of 1 (3 items)
Leave a Comment
  • Please add 1 and 4 and type the answer here:
  • Post