2009-04-14 4 views

답변

0

.vcproj & .sln 파일은 ascii 형식이므로 매크로/스크립트/프로그램을 작성하여 프로젝트 목록을 실행하고 .sln 파일에 적절한 정보를 삽입 할 수 있습니다. 프로젝트에 대해 알아야 할 추가 정보는 .vcproj 파일 (각 프로젝트의 빌드 구성이 동일하다고 가정)에서 찾을 수있는 프로젝트 GUID입니다. 여기

+0

맞음 하지만 기존 솔루션을 찾고있었습니다.) – user68416

4

내가 그것을 할 거라고 방법은 다음과 같습니다

  1. 만들고 (파일 -> 새 프로젝트 -> 기타 프로젝트 유형 -> 비주얼 스튜디오 솔루션 -> 빈에 vcproj 파일을 삽입 할 빈 솔루션을 저장 솔루션)

  2. 솔루션에 프로젝트를 추가하고 솔루션을 저장하고 종료하는 VS 매크로를 만듭니다. 다음보십시오 :

    Public Sub AddProjectAndExit(Optional ByVal vcprojPath As String = "") 
        If Not String.IsNullOrEmpty(vcProjPath) Then 
         DTE.ExecuteCommand("File.AddExistingProject", vcprojPath) 
         DTE.ExecuteCommand("File.SaveAll") 
         DTE.ExecuteCommand("File.Exit") 
        End If 
    End Sub 
    
  3. 이 된 .vcproj 파일의 각 반복, Visual Studio 명령 프롬프트에서이 매크로를 실행하는 배치 스크립트를 작성합니다. 단일 실행의 명령은 다음과 같습니다

    devenv.exe BlankSolution.sln /Command "Macros.MyMacros.Module1.AddProjectAndExit MyProject1.vcproj" 
    

희망하는 데 도움이!

0

수정 및 기존 vcwizard.

function CreateCustomProject(strProjectName, strProjectPath) 
{ 
    try 
    { 
      //This will add the default project to the new solution 

      prj = oTarget.AddFromTemplate(strProjTemplate, strProjectPath, strProjectNameWithExt); 


      //Create a loop here to loop through the project names 
//you want to add to the new solution. 
      var prjItem = oTarget.AddFromFile("C:\\YourProjectPath\\YourProject.vcproj", false); 


     } 
     return prj; 
    } 
    catch(e) 
    { 
     throw e; 
    } 
} 
관련 문제