XNA Creators Club Online
Page 1 of 1 (8 items)
Sort Posts: Previous Next

GS 2.0 XNAPack only works with C# games???

Last post 09/10/2008 16:41 by Stephen Styrchak. 7 replies.
  • 02/10/2008 14:04

    GS 2.0 XNAPack only works with C# games???

    Am I right in saying that GS 2.0 XNAPack only works with C# games?

    Does XNAPack specifically check which langauge an XNA game is written in before packaging it up.

    The error I'm getting is Error 1601: Packaging the startup assembly "C:\Development\XNA\Oxygene\XNA\Tutor ial1\Tutorial1\bin\x86\Release\Tutorial1.exe" is unsupported for this toolset. Please use XNA Game Studio Express 1.0 Refresh tools to package this game.

    Any ideas? Suggestions?
    There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.
    -= Paulo Coelho =-
  • 02/10/2008 14:07 In reply to

    Re: GS 2.0 XNAPack only works with C# games???

    I'm not sure about language but it seems to know which version of the framework you are using... you appear to be trying to pacakge a GSE 1.0 refresh game.
    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 02/10/2008 16:30 In reply to

    Re: GS 2.0 XNAPack only works with C# games???

    This error means your assembly doesn't contain the information that identifies which XNA Framework runtime is required to run your game. XNA Game Studio 2.0 and onward embeds this information in every game assembly you build. Since we didn't embed that information in XNA Game Studio 1.0/1.0 Refresh, the error message makes the assumption that the game must have been built with a version prior to 2.0.

    If your game is not written in C#, then you are obviously not using XNA Game Studio -- and that's why you're missing this information from your assembly.

    To get the missing data into your assembly, follow these steps:

    1. Create an XNA Game Studio game project for the platform that matches your game.
    2. Build that project.
    3. Open Explorer and browse to the intermediate output directory of the project you built (eg, obj\Xbox 360\Debug).
    4. Observe the file called Microsoft.Xna.Framework.RuntimeProfile.txt.
    5. Now open the non-Game Studio project you used to build your game.
    6. Add the Microsoft.Xna.Framework.RuntimeProfile.txt file to your game's project.
    7. Set the item's Build Action property to Embedded Resource.
    8. Close the project.
    9. Open the project's MSBuild project file (.vbproj?) in the code editor (it's XML).
    10. Find the <EmbeddedResource> element that includes the .txt file, and add the following child element:

      <LogicalName>Microsoft.Xna.Framework.RuntimeProfile</LogicalName>

    Now your project is set up to embed the information used by xnapack.exe.

    The runtime profile is a token that identifies the runtime requirements of the assembly. It maps to a specific version of the XNA Framework - so they are different for Zune, Xbox 360, Windows, as well as different for CTP, Beta, and final releases.

    When you use XNA Game Studio, we manage this information for you so that the project and the tools work correctly together, and you are given appropriate error messages when you try to mix and match incompatible assemblies. However, when you don't use XNA Game Studio to build your games, you can't expect the rest of the tools to work for you, either. This is part of what we mean when we say that we only support C#.

     

     

    Stephen Styrchak | XNA Game Studio Developer
  • 02/10/2008 20:34 In reply to

    Re: GS 2.0 XNAPack only works with C# games???

    Hi Stephen,
       Thanks for the detailed instructions. I fully understand Microsoft's statement of only supporting C# in XNA GS so am gratefull for the extra info.
    I will be sure to try out those steps tomorrow. The actual MSBuild project file will be .oxygene, but I'll worry about that.
    I'll report back about how I go.

    Thanks again.

    There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.
    -= Paulo Coelho =-
  • 03/10/2008 12:46 In reply to

    Re: GS 2.0 XNAPack only works with C# games???

    Hi Stephen
    I followed your instructions, but still get the same error. When I use reflector on the .exe I can see the embeded file and it has been renamed to CamerasTutorial.Properties.Microsoft.Xna.Framework.RuntimeProfile.txt and it's contents say v2.0.This is what the Embed XML looks like

    <EmbeddedResource Include="Properties\Microsoft.Xna.Framework.RuntimeProfile.txt"
          <LogicalName>Microsoft.Xna.Framework.RuntimeProfile</LogicalName> 
        </EmbeddedResource>  

     Am I missing something else?

    There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.
    -= Paulo Coelho =-
  • 04/10/2008 19:12 In reply to

    Re: GS 2.0 XNAPack only works with C# games???

    Initially, I missed that you were using v2.0. In v2.0, we only had one runtime token for both Windows and Xbox 360 -- which is a mistake we have remedied in our subsequent releases. So for a CCGAME created with v2.0 XnaPack, the runtime token is expected to be "v2.0" as you inquire.

    Getting this to work properly will depend on how well you understand MSBuild and your project's MSBuild integration.

    Since you are using a compiler that I'm not familiar with, I can't say exactly what you need to do to embed the resource correctly. In a VB or C# MSBuild-based project, the Microsoft.Common.targets file is imported to do most of the work. According to these targets, if a LogicalName is specified, it is used as the name of the manifest resource - otherwise, one is assigned based on the project's default namespace, the location of the item, and the item's name.

    If you build a default Windows Game project, you'll see in the Output Window that the runtime profile is specified on the C# compiler command-line like this:

    /resource:obj\x86\Debug\WindowsGame6.obj.x86.Debug.Microsoft.Xna.Framework.RuntimeProfile.txt,Microsoft.Xna.Framework.RuntimeProfile

     (Sorry, not sure why that pasted so small, or why I can't change the size after the fact...)

    If your compiler supports specifying the logical name of the resource, then you need to set up your project to specify it, according to your product documentation.

    Sorry I can't be of any more help - embedding resources is a compiler-specific action, and even if it's available, the MSBuild project might not support providing a non-default name. You'll need to check your product documentation or ask the vendor.

    Stephen Styrchak | XNA Game Studio Developer
  • 09/10/2008 13:01 In reply to

    Re: GS 2.0 XNAPack only works with C# games???

    I accosted the developers of the compiler and they are now adding support for LogicalName, so I hope this should be fixed in the next beta release.

     One last question... Is the line

    /resource:obj\x86\Debug\WindowsGame6.obj.x86.Debug.Microsoft.Xna.Framework.RuntimeProfile.txt,Microsoft.Xna.Framework.RuntimeProfile

    generated by

     <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\v2.0\Microsoft.Xna.GameStudio.Common.targets" /> directive?

    Or by the C# compiler?

    Thanks again for all your help.

    There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.
    -= Paulo Coelho =-
  • 09/10/2008 16:41 In reply to

    Re: GS 2.0 XNAPack only works with C# games???

    CartBlanche:
    One last question... Is the line

    /resource:obj\x86\Debug\WindowsGame6.obj.x86.Debug.Microsoft.Xna.Framework.RuntimeProfile.txt,Microsoft.Xna.Framework.RuntimeProfile

    generated by

     <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\v2.0\Microsoft.Xna.GameStudio.Common.targets" /> directive?

    Or by the C# compiler?

    Neither.

    The Game Studio targets only generate the TXT file and add it to the list of embedded resources, along with the logical name. The MSBuild targets that process EmbeddedResource items are in Microsoft.Common.targets, which is installed with the .NET Framework. In a C# project, most of the work is done by Microsoft.Common.targets, but eventually a number of computed values are passed to targets in Microsoft.CSharp.targets (also installed by the .NET Framework).

    The list of resources to embed is passed to the CSC task, which constructs the command-line. The command-line is then passed to the C# compiler.

    So really Game Studio does not do anything special, except to add the TXT file to your project without having it appear in the Solution Explorer. If you followed the steps I described previously in a normal C# project, you'd get the exact same result as building a Game Studio project.

    The C# compiler doesn't generate the command-line because the C# compiler doesn't run until it is given the command-line to execute.

    Stephen Styrchak | XNA Game Studio Developer
Page 1 of 1 (8 items) Previous Next