Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to build a project for Xbox, and when I try to Package as an XNA Creator's Club Game I receive the following errors:

The best overloaded method match for 'Pong.MessageBoxScreen.MessageBoxScreen(Microsoft.Xna.Framework.Game, string)' has some invalid arguments.

Argument 1: cannot convert from 'string' to 'Microsoft.Xna.Framework.Game'

Argument 2: cannot convert from 'bool' to 'string'

        /// <summary>
    /// Event handler for when the Unlock Game menu entry is selected.
    /// </summary>
    void UnlockMenuEntrySelected(object sender, PlayerIndexEventArgs e)
    {
 #if XBOX
        try
        {
            Guide.ShowMarketplace(e.PlayerIndex);
        }
        catch (GamerPrivilegeException gamerPrivilegeException)
        {
            const string message = "Please use Xbox Live account.";

            MessageBoxScreen promptForPurchase = new MessageBoxScreen(message, false);
            ScreenManager.AddScreen(promptForPurchase, e.PlayerIndex);
        }
 #else
        const string message = "Unlock Full Game (Xbox Only)";
        MessageBoxScreen unlockMessageBox = new MessageBoxScreen(Game, message,      false);
        ScreenManager.AddScreen(unlockMessageBox, e.PlayerIndex);

 #endif
    }

Everything within the #if XBOX area is grayed out, I suppose because it is surrounded by that tag.

What do you think is suddenly causing these issues, and how can I correct it?

share|improve this question
    
I see code, but no error messages. –  David Lively Aug 18 '12 at 20:40
    
What error? Please edit post. –  Justin Skiles Aug 18 '12 at 20:41
    
Sorry, I accidentally hit "post" while I was in the middle of writing the post :p. I've since added it –  Dave Voyles Aug 18 '12 at 20:42
add comment

1 Answer

up vote 4 down vote accepted

Based on the exception, it appears this line is at fault:

MessageBoxScreen promptForPurchase = new MessageBoxScreen(message, false);

You'll see that the error message tells you exactly what is wrong. You are passing arguments that are invalid for that constructor. You need to pass a Microsoft.Xna.Framework.Game object as the first argument and a String as the second argument.

share|improve this answer
    
That was exactly it. I don't remember ever changing this constructor, but when I went back and compared it to the GSM sample, it appears that I must have at some point. Thank you! –  Dave Voyles Aug 20 '12 at 10:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.