Microsoft 开发人员网络 > 论坛主页 > Visual Studio Extensibility > SDK Package, EnvDTE80.DTE2: The source control provider associated with this solution could not be found, The projects will be treated as not under source control. Do you want to permanently remove the source control bindings from the projects?
提出问题提出问题
 

问题SDK Package, EnvDTE80.DTE2: The source control provider associated with this solution could not be found, The projects will be treated as not under source control. Do you want to permanently remove the source control bindings from the projects?

  • 2009年6月30日 11:36subhasis.khatua 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     包含代码
    Environment Details:
    ==================
    Visual Studio: 2005 (RTM 8.0.50727.42)
    .NET Framework: 2.0.50727 SP1
    OS: Win 2003
    Language: C#


    Steps:
    ==================
    1. Using VSPackage implementation, I have added (checked in) the following solution and projects to some SCC provider.

    a>

    Solution 1
        |
        ---- Project 1

    b>

    Solution 2
        |
        ---- Project 2


    2. Now I have closed the solutions.

    3. Created a tool window (SCC Explorer) already, where user can browse the SCC controlled solutions, projects by the SCC provider.

    3. From that tool window (SCC Explorer, within VS IDE), opened the first solution (Solution 1).        

    IVsSolution solutionService = Package.GetGlobalService(typeof(SVsSolution)) as IVsSolution;
    string solutionFile = System.IO.Path.Combine(clientPathSolution, versionName); //e.g. "C:\ABC\Solution 1.sln"
    
    uint grfOpenOpts = (uint) __VSSLNOPENOPTIONS.SLNOPENOPT_Silent;
    solutionService.OpenSolutionFile(grfOpenOpts, solutionFile);
    
    4. This opens the solution with other project(s) in it. Also, it shows proper glyphs associated with them (managed by some SCC provider).

    Solution 1
        |
        ---- Project 1

    5. From tool window (SCC Explorer, within VS IDE), selected project 'Project 2' and trying to add the project to the open solution 'Solution 1'.

    System.Type vsType = System.Type.GetTypeFromProgID("VisualStudio.DTE.8.0");
    Object vs = System.Activator.CreateInstance(vsType, true);
    EnvDTE80.DTE2 dte8Obj = (EnvDTE80.DTE2)vs;
    
    EnvDTE80.Solution2 dteSolution = (EnvDTE80.Solution2)dte8Obj.Solution;
    
    ...
    
    //Added the project using DTE2
    if (dteSolution.IsOpen)
    {
        try
        {
             //IVsSolution2 solutionService2 = Package.GetGlobalService(typeof(IVsSolution2)) as IVsSolution2;
             //Question: If I don't want to use DTE2, how do I use any Service (e.g.  IVsSolution, IVsSolution2) to perform the same 
    
             EnvDTE.Project projectAdded = dteSolution.AddFromFile(fileSelected, false);
    
    ...
    
    //Opening the solution
    IVsSolution solutionService = Package.GetGlobalService(typeof(SVsSolution)) as IVsSolution;
    
    uint grfOpenOpts = (uint)__VSSLNOPENOPTIONS.SLNOPENOPT_Silent; solutionService.OpenSolutionFile(grfOpenOpts, solutionFile);
    
    

    6. In the following line, I see a warning message getting popped up.

    EnvDTE.Project projectAdded = dteSolution.AddFromFile(fileSelected, false);

    Message:
    The source control provider associated with this solution could not be found, The projects will be treated as not under source control. Do you want to permanently remove the source control bindings from the projects?      


    Questions:  
    ==============
    1. I am using a mix of both VSPackage and DTE/DTE2. So, the incompatibility happens and the warning message is popped up. What information does DTE/DTE2 expect in the solution file to check SCC/SCC provider related information?
    Because even though the solution (Solution 1) is managed by SCC provider, DTE API complains that the solution is not managed.

    2. I don't want to use DTE/DTE2 at all, instead want to use corresponding service from VSPackage. What are the corresponding services and how do I achieve the things for which I am using DTE?


    Where Does the Problem Happen:
    ========================
    Currently it is under development stage, so only in devlopment.


全部回复