locked
GUID of SISS Project in VS2010 is different than that of what it was in VS2008. Why? RRS feed

  • Question

  • In my VsPackage I check the GUID of the project to make some decisions specific to the project type. 

    I am seeing that in VS2010 the GUID of SISS Project is changed than what it was in VS2005 and VS2008.

    GUID for other BI Project templates are not changed as such, then why for SISS Project?

    As a workaround, is there any other way to find out what kind of project (like BI Project, Setup Project, etc) the IVsHierarchy is referring to?

    Please help asap.

    Thanks in advance,

    Regards,

    Ganesh Agrawal


    Thanks, Ganesh Agrawal

    Wednesday, August 21, 2013 6:46 AM

All replies

  • There is no guarantee of that sort. It just means an SSIS 2010 project is not the same as an SSIS 2005 or SSIS 2008 project, although display names don't make a clear distinction for humans like us.

    You can determine a project type from the hierarchy with a code like this:

    public static Guid GetProjectType(IVsHierarchy hierarchy)
    {
        Guid projectType;
        hierarchy.GetGuidProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_TypeGuid, out projectType);
        return projectType;
    }


    Simon Mourier

    Wednesday, August 21, 2013 9:33 PM
  • Hi Simon,

    My requirement is:

    "From a given hierarchy object I need to know if this item belongs to one of the Business Intelligence Project"

    You have provided a way to get the Guid of the project from an hierarchy. And you are saying that its not guaranteed to be the same in every IDE. So, getting GUID of any project is of no use to me as I can not compare it with the GUID id I store to decide weather it is a Business Intelligence Project.

    For example, I store the following:

    BI_REPORT_SERVER_PROJECT_ID = f14b399a-7131-4c87-9e4b-1186c45ef12d

    BI_REPORT_MODEL_PROJECT_ID = 999d2cb9-9277-4465-a902-1604ed3686a3

    BI_IMPORT_ANALYSIS_PROJECT_ID = d2abab84-bf74-430a-b69e-9dc6d40dda17

    BI_REPORT_SERVER_PROJECT_WIZARD_PROJECT_ID  = f14b399a-7131-4c87-9e4b-1186c45ef12d                      

    BI_ANALYSIS_PROJECT_ID = d2abab84-bf74-430a-b69e-9dc6d40dda17

    BI_INTEGRATION_SERVICE_PROJECT_ID = d183a3d8-5fd8-494b-b014-37f57b35e655

    Now if I use the logic you provided to get the GUID from hierarchy.GetGuidProperty method, I can get the guid of the project the item belongs to and I can compare with the existing IDs I have to determine if this is an item from REPORT SERVER PROJECT or INTEGRATION SERVICE PROJECT, etc.

    But for this logic to work Microsoft must not change the GUID of any project type across Visual Studio IDEs (i.e. VS2005, VS2008, VS2010, VS2012, etc)

    And Microsoft does keep the same except for the fact that in VS2010 Microsoft has changed the GUID of INTEGRATION SERVICE PROJECT from d183a3d8-5fd8-494b-b014-37f57b35e655 to 159641d6-6404-4a2a-ae62-294de0fe8301

    So, our logic to get the GUID and compare it with known GUID does not work anymore.

    Now, my question is:

    1) Is it not a bug in VS2010 that GUID of INTEGRATION SERVICE PROJECT has changed its value than what it was in VS205 and VS2008? 

    2) Why only for INTEGRATION SERVICE PROJECT it got changed but not for other projects like REPORT MODEL, REPORT SERVER, ANALYSIS SERVER, etc?

    3) If its not guaranteed to persist its value across IDEs versions, than what is the right way to get to know from hierarchy which kind of project it belongs to?  (I need to know weather the item belongs to INTEGRATION SERVICE PROJECT or not)

    Thanks in advance,

    Ganesh







    Thanks, Ganesh Agrawal

    Thursday, August 22, 2013 5:35 AM
  • I can't speak for Microsoft, but my experience is the following:

    We have a VSPackage that supports Visual Studio 2008, 2010, 2012 and 2013 and yes, we have code specific for each version of Visual Studio. When Microsoft pushes out a new version, we have to check everything works fine, and we sometimes have to add new code to keep our product running. Nobody can guarantee the future :-)


    Simon Mourier

    Thursday, August 22, 2013 8:35 AM
  • Thanks a lot for your quick reply Simon.

    I would also like to hear from Microsoft if this is something they think is a bug as GUID in general does not change for any project and if it will, it can break existing code for VS Packages people have built. And thats what exactly in our case too. We wrote a code which worked for VS2005, VS2008, but now breaks for VS2010 and VS2012 and VS2013 and by debugging I could figure out that its only because of that changed GUID :-(



    Thanks, Ganesh Agrawal

    Thursday, August 22, 2013 1:31 PM
  • Hi Ganesh Agrawal,

    Thank you for your post.

    I have escalated this issue to the professionals for better response.

    They would make efforts to troubleshoot it in as short a time as possible.

    Thank you for your understanding.

    Best Regards.

    Jane.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, August 23, 2013 11:19 AM
  • Hi,

    You can try refer to this articles:

    - http://www.mztools.com/articles/2007/MZ2007016.aspx

    - http://www.mztools.com/articles/2008/mz2008017.aspx


    Regards,
    Christian HL
    Microsoft Online Community Support


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Monday, August 26, 2013 2:34 AM
  • Hi,

    Thanks Christian for the links.

    I have gone through your post and it tells me how to get the Project Type Guid. I do the same with the following logic in my code:

    public static bool isBIProject(IVsHierarchy hier)

    {

    try
                {
                    if (hier == null)
                    {
                        return false;
                    }              

                    IVsSccProject2 project = (hier as IVsSccProject2);
                    if (project == null)
                    {
                        return false;
                    }
                   
                    IPersistFileFormat pFileFormat = project as IPersistFileFormat;
                    if (pFileFormat != null)
                    {
                        Guid guidClassID;
                        if (VSConstants.S_OK == pFileFormat.GetClassID(out guidClassID))
                        {
                            if (guidClassID == BI_ANALYSIS_PROJECT_ID)
                                return true;
                            if (guidClassID == BI_ANALYSIS_SERVICES_PROJECT_ID)
                                return true;
                            if (guidClassID == BI_INTEGRATION_SERVICE_PROJECT_ID)
                                return true;
                            if (guidClassID == BI_REPORT_MODEL_PROJECT_ID)
                                return true;
                            if (guidClassID == BI_REPORT_SERVER_PROJECT_ID)
                                return true;
                            if (guidClassID == BI_REPORT_SERVER_PROJECT_WIZARD_PROJECT_ID)
                                return true;
                        }
                    }

                }

    (GUID of the project types are specified in the previous posts)

    Now, in VS2005, VS2008, VS2010, VS2012, the GUID of all these projects are unchanged except the GUID of BI_INTEGRATION_SERVICE_PROJECT_ID. My questions are

    1) Are Project Type GUIDs not supposed to be same across IDEs? As per your link, unless Project Type Guids are same, its not possible to compare them to decide anything.

    2) What logic should I use to make sure that the hierarchy I have is of BI project type if the GUIDs keep changing across IDEs versions.

    We are facing big trouble and need help immediately. Kindly reply asap.

    Thanks again for all your help.

    Regards,

    Ganesh Agrawal



    Thanks, Ganesh Agrawal

    Monday, August 26, 2013 3:08 PM
  • Hi,

    Search through registry keys that explained by the article, you can find the GUID for each project type for each Visual Studio version that you use.


    Regards,
    Christian HL
    Microsoft Online Community Support


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Tuesday, August 27, 2013 1:47 AM
  • Hi All,

    I tried getting the GUID by writing a logic to read through the registry based on the name of the "Default" string in the key. But to my surprise even that does not work as for some projects, I get value of "Default" string as "Analysis Services Project" which clearly tells me that it is of type BI Projects. But for some other projects, it is just something like "#5001", for example, for Report Server projects.

    My requirement is simple. Given a IVsHierarchy of an item, how do I know if it is a BI Project item or not? 

    I can hard code the GUID and then compare based on the logic provided earlier. But does that mean for every new Visual Studio release, I need to check the registry and add any changed GUID with an another check?

    Remember, we ship our VsPackage and I dont know which version of Visual Studio is installed in user's machine where it will run. So, I can not go and update the GUID manually from his system. I need to do it pragmatically.

    Thanks in advance,

    Regards,
    Ganesh Agrawal


    Thanks, Ganesh Agrawal

    Friday, August 30, 2013 12:28 PM