Partilhar via


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

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.

Comments

  • Anonymous
    November 09, 2011
    It's in the release notes.  Sigh.  :)

  • Anonymous
    November 09, 2011
    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.

  • Anonymous
    November 20, 2011
    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.