Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Wizard: Error adding project reference (not DLLs) in ProjectFinishedGenerating method of IWizard.

$
0
0

Extension: Wizard

IDE: Visual Studio 2010 SP1

OS: Windows 7 Ultimate SP1 (64 bit)

Language: C#

Error: "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"

Code:

public void ProjectFinishedGenerating(Project project)
{
            AddProjectReference(project, (Project)project.DTE.Solution.Projects.Item("Filters"));

}

private void AddProjectReference(EnvDTE.Project project, EnvDTE.Project projectToReference)
{
            VSLangProj.VSProject vsProject = (VSLangProj.VSProject)project.Object;
            vsProject.References.AddProject(projectToReference);
}

Occurs on: Dev machine, as I have not been able to get past this error.

Reproduction steps:

1. Open Visual Studio 2010 SP1

2. Open existing solution that contains existing projects, one of which is called "Filters"

3. Right click the existing solution, in the solution explorer, and click Add -> New project

4. Select the wizard I created. This wizard implements the IWizard interface and runs without issue except for the error when attempting to add

5. Add project name

6. Click Finish

7. At this point, wizard attempts to add the reference to the "Filters" project, and I get the error.

Thanks for your help - I am really scratching my head on this one. It seems so simple, yet it is not working and this is the pnly thing holding up my extension.



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>