Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Error while displaying the Current Project name in a Text box of a Custom Wizard Page
 

Error while displaying the Current Project name in a Text box of a Custom Wizard Page

Hi,

I need to display all the methods from the referenced dlls of a project.

I'm trying to display the currently selected project path in a text box of a Custom wizard page.

i have mentioned an argument like this:

<Recipe Name="CheckProjectsPopulating" Recurrent="false">

<Types>

<TypeAlias Name="Evaluator" Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.ExpressionEvaluatorValueProvider,Microsoft.Practices.RecipeFramework.Library" />

</Types>

<Caption>List ofmethods of Referenced dllsin Current Project</Caption>

<HostData>

<Icon ID="630"/>

<CommandBar Name="Project"/>

</HostData>

<Arguments>

<Argument Name="CurrentProject" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

<ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.FirstSelectedProject, Microsoft.Practices.RecipeFramework.Library" />

</Argument>

</Arguments>

<GatheringServiceData>

<Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">

<Pages>

<Page Type="MyGPTestOnMarchNinteen.Recipes.MyUI.RetrieveClassesAndMethods, MyGPTestOnMarchNinteen">

</Page>

</Pages>

</Wizard>

</GatheringServiceData>

</Recipe>

And the code for Custom wizard page is

public partial class RetrieveClassesAndMethods : CustomWizardPage

{

public RetrieveClassesAndMethods()

{

InitializeComponent();

}

public RetrieveClassesAndMethods(WizardForm wp) : base(wp)

{

InitializeComponent();

}

[RecipeArgument]

public string CurrentProject

{

set

{

if (value != null)

{

this.textBox1.Text = value.ToString();

}

else

{

this.textBox1.Text = "";

}

}

}

//CurrentProject

private void button1_Click(object sender, EventArgs e)

{

IDictionaryService dictservice = GetService(typeof(IDictionaryService)) as IDictionaryService;

if (string.IsNullOrEmpty(textBox1.Text.ToString()))

dictservice.SetValue("CurrentProject", null);

else

dictservice.SetValue("CurrentProject", textBox1.Text.ToString());

}

}

I'm getting the below error while running the recipe:

The wizard failed to execute. The error was:
Cannot set property CurrentProject from Custom Page RetrieveClassesAndMethods.

Can anyone help me out whether i need to add anything elseto my code to solve this error.

Regards,

Syamala.

Syamala_rsv  Wednesday, April 09, 2008 6:40 AM

Hi Syamala,

It's failing because you've declared a CurrentProject which type is a EnvDTE.Project, but in your custom wizard page you've created a CurrentProject which type is a String, you should change the type of the property and it should be works fine.

hth

jose.

Jose Escrich  Thursday, April 10, 2008 2:45 PM

Hi Syamala,

It's failing because you've declared a CurrentProject which type is a EnvDTE.Project, but in your custom wizard page you've created a CurrentProject which type is a String, you should change the type of the property and it should be works fine.

hth

jose.

Jose Escrich  Thursday, April 10, 2008 2:45 PM

You can use google to search for other answers

Custom Search

More Threads

• SCSF Stopped Working correctly
• Get StrongDataSet reference
• Beta 2 Class Wizard does not work
• Synchronizing - GAT Package Changes
• Installation issue with web service software factory
• Creating Data Repository classes.
• Cannot use customized Visual Studio 2008 template
• Uninstall of February 2008 GAX fails
• Can't see item templates for WebApplication projects
• Registering Guidance Package in visual studio express editions