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

  • SEARCH
  • Home
  • 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 9115521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:27:10+00:00 2026-06-17T04:27:10+00:00

I am using the following code : Object projObj = htProjects[selectedNode]; // htProjects is

  • 0

I am using the following code :

Object projObj = htProjects[selectedNode]; // htProjects is a Hashtable:key-project Name,value-ENVDTE.Project
Project selectedProject = (Project)projObj; 

I am getting the following error :

Unable to cast COM object of type 'System.__ComObject' to interface type 'EnvDTE.Project'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{866311E6-C887-4143-9833-645F5B93F6F1}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

I tried registering DLLS as mentioned here but there seems to be some other issue.

  • 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-17T04:27:11+00:00Added an answer on June 17, 2026 at 4:27 am

    Found the solution. Some hashtable entries had ENVDTE.ProjectItems as value. So a check was needed.

    Code:

            if (projObj is Project)
            {
                Project selectedProject = (Project)projObj;
                MessageBox.Show(selectedProject.FullName);
            }
            else if(projObj is ProjectItem)
            {
                ProjectItem selectedProject = (ProjectItem)projObj;
                MessageBox.Show(selectedProject.get_FileNames(1));
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following code in rowdatabound function. Protected Sub gvwMileStone_RowDataBound(ByVal sender As System.Object,
Using the following code, we got the error 'Object is currently in use elsewhere'
Im using the following code to place an object inside a container: testParent =
I am using the following code to serialize an object to XML, StringBuilder sb
I am using the following code to save an object and all its properties
I have the following code which outputs an object to an XML file: using
Using dotnet 2.0. Can the following code be improved in style ? private object
What is the difference between the following two snippets of code: using (Object o
I am using the following code to build object for posting via ajax: eval('var
I am using the following code to perform drag operation on NSTextView object. -

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.