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

Content Pipeline Extension Library annoyances

Last post 06-24-2008 9:37 PM by Brandon Bloom. 11 replies.
  • 12-16-2007 2:03 AM

    Content Pipeline Extension Library annoyances

    I was hoping a CPEL project would allow me to easily debug my custom Content Pipeline extensions. To use the debugger in 1.0  during custom content building, you had to explicitly launch the debugger from within the code by calling System.Diagnostics.Debugger.Launch(). If an exception was thrown and left unhandled, instead of launching the debugger, all you would get is a build error and stack trace in the output. This exact same problem remains with CPEL projects. This is very annoying for developing complex custom pipeline extensions. And as far as I can tell, you can still write custom content pipeline extensions in a Windows Game Library or Xbox 360 Game Library project, reference it in your game project, and you can custom build and load content just fine.

    So what exactly are the advantages to using the Content Pipeline Extension Library project and will the debugger problems be fixed in a future release?
  • 12-16-2007 4:54 AM In reply to

    Re: Content Pipeline Extension Library annoyances

    Answer

    The Content Pipeline Extension Library template provides a project that is configured to conveniently build Content Pipeline Extensions. It wasn't intended to solve any issues related to debugging.

    The Content Pipeline Extension Library is intended to help people get started in extending the XNA Framework Content Pipeline. In addition, it contains configuration settings that allow it to be referenced from a content project targeting either Windows or Xbox 360, without any further customization of project dependencies or solution configurations. In XNA Game Studio Express 1.0, it was not at all intuitive to set up the project dependencies and solution configuration settings for Xbox 360 development. Now it is.

    Finally, this template helps people choose the right kind of project for Content Pipeline extensions. A game library is not the right kind of project. Xbox 360 game libraries won't always work, even for people who manage to add the appropriate references in the first place. In addition, game libraries have nested content projects, which are never useful when you're building something that is intended to be used to build content. Game library projects also have features for cross-platform development that don't make sense for Content Pipeline extensions, since the extension is always executed on the Windows PC, and never deployed to an Xbox 360 console.

    If you have VS 2005 (as opposed to VC# 2005 Express), then you can follow the instructions here to learn how to more easily debug your content build. You'll need to scroll down to the section at the bottom of the page.

     

     

    Stephen Styrchak | XNA Game Studio Developer
  • 12-16-2007 3:42 PM In reply to

    Re: Content Pipeline Extension Library annoyances

    Thanks Stephen!
  • 01-25-2008 5:21 AM In reply to

    Re: Content Pipeline Extension Library annoyances

    After thinking about this a bit more, I decided to dust off my abandoned Spaces site and post a couple articles explaining the Content Pipeline debugging story in detail. It'll be pretty dry reading for most people, but I just finished off the series by uploading a template that lets you debug the Content Pipeline from the IDE (either VS or VCSExpress).

    Here's a link to skip directly to the exciting conclusion!

    http://badcorporatelogo.spaces.live.com/blog/cns!43EB71B104A2D711!169.entry

     

    Stephen Styrchak | XNA Game Studio Developer
  • 01-25-2008 4:14 PM In reply to

    Re: Content Pipeline Extension Library annoyances

    Another option might be to use something similar to the WinFormsContentLoadingSample to debug your custom processor. This also has the advantage of allowing a more interactive approach to debugging your custom content processor.

    David

  • 05-08-2008 9:11 AM In reply to

    Re: Content Pipeline Extension Library annoyances

    dblack:

    Another option might be to use something similar to the WinFormsContentLoadingSample to debug your custom processor. This also has the advantage of allowing a more interactive approach to debugging your custom content processor.

    David



    Can you go further into detail ? How can we use our custom processor inside that sample ?

    I cannot use the other methods to debug because I have some strange errors... In case you understand what the compiler is saying...

    'msbuild.exe' (Managé) : 'E:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll' chargé, aucun symbole chargé.
    'msbuild.exe' (Managé) : 'E:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild.exe' chargé, aucun symbole chargé.
    'msbuild.exe' (Managé) : 'E:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll' chargé, aucun symbole chargé.
    'msbuild.exe' (Managé) : 'E:\WINDOWS\assembly\GAC_MSIL\Microsoft.Build.Engine\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Engine.dll' chargé, aucun symbole chargé.
    'msbuild.exe' (Managé) : 'E:\WINDOWS\assembly\GAC_MSIL\Microsoft.Build.Framework\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Framework.dll' chargé, aucun symbole chargé.
    'msbuild.exe' (Managé) : 'E:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\fr\MSBuild.resources.dll' chargé, aucun symbole chargé.
    'msbuild.exe' (Managé) : 'E:\WINDOWS\assembly\GAC_MSIL\mscorlib.resources\2.0.0.0_fr_b77a5c561934e089\mscorlib.resources.dll' chargé, aucun symbole chargé.
    Une exception de première chance de type 'Microsoft.Build.CommandLine.CommandLineSwitchException' s'est produite dans msbuild.exe
    Le programme '[3556] msbuild.exe: Managé' s'est arrêté avec le code 1 (0x1).
    Boo
  • 05-09-2008 7:06 PM In reply to

    Re: Content Pipeline Extension Library annoyances

    ungala:

    Can you go further into detail ? How can we use our custom processor inside that sample ?

    I cannot use the other methods to debug because I have some strange errors... In case you understand what the compiler is saying...

    [...]

    Une exception de première chance de type 'Microsoft.Build.CommandLine.CommandLineSwitchException' s'est produite dans msbuild.exe
    Le programme '[3556] msbuild.exe: Managé' s'est arrêté avec le code 1 (0x1).

    That isn't compiler output - it is debugger output. It says you passed an invalid option to the msbuild command line. You should set your debugger to break on exceptions so you can examine the callstack and see what part of your program is invoking msbuild here. That will make it a lot more clear what you need to fix.

    Go to Tools->Options and turn off the "just my code" debugging option, and then go to the Debug->Exceptions... dialog to configure the debugger to break when exceptions are thrown. When the debugger breaks, press Continue until you get to the point in your program where the CommandLineSwitchException is thrown.

     

    Stephen Styrchak | XNA Game Studio Developer
  • 05-27-2008 3:51 PM In reply to

    Re: Content Pipeline Extension Library annoyances

    Hi,

    call me mad, but debugging content processors seems like Holy Graal for me (I m using C# express 2005 edition)

    So I tried to install your template http://badcorporatelogo.spaces.live.com/blog/cns!43EB71B104A2D711!169.entry .

    It gives me following error the "Installation stopped because the directory for the ProjectType value did not exist.  The project type is invalid for your installation of Visual Studio"

    Ok, so read the 3 post and add the following lines to myContentProcessorLibrairy.csproj :

     <PropertyGroup> 
        <AvailablePlatforms>x86,Xbox 360</AvailablePlatforms> 
        <StartAction>Program</StartAction> 
        <StartProgram>$(MSBuildBinPath)\msbuild.exe</StartProgram> 
        <StartWorkingDirectory>$(ProjectDir)</StartWorkingDirectory> 
        <StartArguments>"Test Content\Test Content.contentproj" /logger:DebugOutputLogger,$(OutDir)$(AssemblyName).dll /p:Configuration="$(Configuration)" /p:Platform="$(Platform)" /p:XnaPlatform="$(XnaPlatform)" /p:ParentProjectDir="$(ProjectDir)"</StartArguments
      </PropertyGroup> 


    No results : no break point are reached in the dll code. Ok, so I tried the "System.Diagnostics.Debugger.Launch();" method after installing dotNetFx35setup.exe, the net SDK and the windows debugging tools (dbg_x86_6.9.3.113.msi).

     And then I get the "unable to attach to process" error.

    I checked if my flat is build on a indian cemetery but, fortunately, not.

    What did I miss ?

     

     

     

     


  • 05-27-2008 6:23 PM In reply to

    Re: Content Pipeline Extension Library annoyances

    another one:
    It gives me following error the "Installation stopped because the directory for the ProjectType value did not exist.  The project type is invalid for your installation of Visual Studio"

    The problem could be a simple one. First, make sure you have XNA Game Studio 2.0 installed -- the template won't work in the XNA Game Studio 3.0 CTP. Second, try navigating to your user template folder and creating a subfolder called "XNA Game Studio 2.0" under the Visual C# folder.

    To find your user template folder, start Visual C# Express, and go to Tools->Options. Select "Projects and Solutions" on the left-hand-side, then look at the path specified for the "Visual Studio user project templates location" on the right-hand-side. It'll be something like C:\Users\yourname\Documents\Visual Studio 2008\Templates\ProjectTemplates.

    There should be a folder called "Visual C#" at that location, under which you should create the "XNA Game Studio 2.0" folder. The error you are getting about the ProjectType is most likely related to not being able to create this folder.

    another one:
    Ok, so read the 3 post and add the following lines to myContentProcessorLibrairy.csproj : ...

    The properties you copied are specifically configured for the template. In particular, the StartArguments should point to the content project you want to debug. It has to be a valid relative path, and it should be relative to the StartWorkingDirectory. Also, the logger specified is built by the project created by the template, so you'll need to change that argument or provide a logger. Also, the project containing these properties has to be set as the Startup Project.

    another one:
    ... And then I get the "unable to attach to process" error.

    If you are running Vista, you'll probably need to launch the IDE as administrator so that Debugger.Launch() will launch a debugger with elevated privilege as well.

     

    Stephen Styrchak | XNA Game Studio Developer
  • 06-04-2008 3:19 PM In reply to

    Re: Content Pipeline Extension Library annoyances

    • Error "Installation stopped because the directory for the ProjectType value did not exist.  The project type is invalid for your installation of Visual Studio"
    You were right Stephen. With XNA 2.0, it works when creating the subfolder "XNA Game Studio 2.0" under the Visual C# folder. Well, I must admit that I didn't do the needed modification in the . csproj. Clearly I ve readen this the very good example too fast. But even in taking the time and following the steps carefully, I'm not able to make the template working on my computer. I need to investigate further.
    •  Error "unable to attach to process" with the "System.Diagnostics.Debugger.Launch();" method
    I'm not running vista but XP. But, in fact the problem comes from my installation. The JIT debugger dosn't comes with .Net framework  3.5 (dotNetFx35setup.exe) but with the version 2.0.

     After installing it, it works. So I'm able to debugging content pipeline now . Gloria !

     Thanks for your help.

     

  • 06-24-2008 7:05 PM In reply to

    Re: Content Pipeline Extension Library annoyances

    Stephen,

        Thank you for your assistance, even though you weren't helping me specifically with my issue, your answer solved my problem.  Originally when I had installed VS2005, I had my document file placed on a different hard drive, and after the hard drive died, I had to move it back to the main C drive.  So when it was trying to install the starter kits, it was looking on the old drive.  I updated the pointer in the VS2005 tools->options place and everything works so far.  Thanks for your help.

  • 06-24-2008 9:37 PM In reply to

    Re: Content Pipeline Extension Library annoyances

    *cough* F5 should work for content *cough* :-)
    Brandon Bloom - Hey, I finally work here :-)
    Software Design Engineer
    XNA Community Game Platform