Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8291525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:09:34+00:00 2026-06-08T13:09:34+00:00

We have the following code in wizard to add existing project to a new

  • 0

We have the following code in wizard to add existing project to a new solution:

//generating files
if (dte.Solution.Projects.Count < 1) // Solution is empty or doesn't exist
{
    dte.Solution.Create(oneFolderHigher(Params.OutputDir, solutionName),
                        solutionFileName(solutionName));
}

// adding created project to solution
dte.Solution.AddFromFile(Path.Combine(Params.ProjectRootFolder, 
                                      Params.ProjectName + ".csproj"));

It works just fine under MS Visual Studio 2010, but fails under 2012 (I experimented with second parameter):

System.Runtime.InteropServices.COMException (0x80004004): Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))
at EnvDTE.SolutionClass.AddFromFile(String FileName, Boolean Exclusive)
at Wizard.Generator.NewProjectGenerator.Generate(Action`1 logMessage)
at Wizard.Forms.WizardForm.Finish()

After this error I’m adding the new project to the solution manually and everything works OK. But we can not just say, “Sorry, we can not add newly generated project for you so please add it by yourself.”

MSDN proposes:

You can use the LaunchWizard method rather than AddFromFile to execute a wizard if you want to suppress its UI during execution. LaunchWizard has a parameter that allows you to disable the UI.

But this method requires some wizard file, so it can not be a solution.

Could someone help?
Wizard is running from “New -> Project” menu.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:09:36+00:00Added an answer on June 8, 2026 at 1:09 pm

    Here the workaround for the issue (proposed by my boss):

    Before adding the project to solution, project file should be converted to
    VS2012 format.
    

    But code is little ugly:

    using (StreamReader sr = new StreamReader(newFile))
    using (StreamWriter sw = new StreamWriter(projectFile, false, Encoding.UTF8))
    {
         while (sr.Peek() >= 0)
         {
             string s = sr.ReadLine();
             if (s.Contains("<Project ToolsVersion=\"4.0\""))
             {
                  s = s + Environment.NewLine + importProject;
             }
    ... and so on
    

    Maybe someone knows the way to do it awesome? I mean converting. I’ll let the question to be unanswered some time. Waiting for your comments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to add existing projects to a new solution generated by a
I have following code that I am compiling in a .NET 4.0 project namespace
i have following code example: PlentySoapRequest_GetAuthentificationToken username = new PlentySoapRequest_GetAuthentificationToken(); username.Username = user_textbox.ToString(); username.Userpass
I have following code in initialization im = imread('Image02.tif'); figure(); imagesc(im); colormap(gray); [hImage hfig
I have following code <div id=main> <div id=one> </div> <div id=two> </div> <div id=three>
I have following code for updating user's column public void UpdateLastModifiedDate(string username) { using
I have following code for loading image from url in xml parsing endElement method
I have following code for inserting data into database using PDO. It inserts data
I have following code. ASPX Page <a href=AnyASPXPageOfWebsite.aspx onclick=javascript:CallJQuery(); > Set Price </a> JS
I have following code using hibernate to throw a custom exception on error and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.