Visual studio 2010 특정 폴더 하위의 프로젝트들을 솔루션 하나로 묶기

Published Mar 15, 2013 | Updated Sep 20, 2022 | 0 comments

 

C1 Sample 이 빌드된 Binary 도 없는 데다가 샘플도 각각 열어서 직접 빌드한 다음 확인하는게 넘 불편해서리

 

솔루션 하나로 쉽게 묶을 방법을 찾다가………

 

VS Extension 이 있을까해서 찾아봤지만 없네? 예전에 본것 같은데.. 현재로써는 검색 실패!!………

 

………

 

add multiple existing project to Solution 을 구글링하다가 발견

 

참조 경로 : http://stackoverflow.com/questions/1891035/easy-way-to-add-multiple-existing-csproj-to-a-visual-studio-solution

 

==============================================================================================

편의를 위해 VS 2010 에 PowerConsole Extension 설치 후

 

PowerConsole 창에서 다음을 실행(참조 경로의 내용에서 살짝만 수정함)

 

$scriptDirectory = “D:KKOMZICode_TestC1Samples”
$dteObj = [System.Activator]::CreateInstance([System.Type]::GetTypeFromProgId(“VisualStudio.DTE”))

$slnDir = “.”
$slnName = “All”
$pjtDir = “C:Program Files (x86)ComponentOne Studio.NET 2.0C1FlexGridSamplesCS”

$dteObj.Solution.Create($scriptDirectory, $slnName)
(ls $pjtDir -Recurse *.csproj) | % { $dteObj.Solution.AddFromFile($_.FullName, $false) }

$dteObj.Solution.SaveAs( (Join-Path $scriptDirectory ‘All.sln’) )

$dteObj.Quit()

솔루션 파일 경로와 프로젝트를 로딩할 경로를 각각 지정해서

지정된 폴더 하위의 프로젝트들을 솔루션 하나로 묶어줌.

 

VS2010 에서 테스트 해보니 현재 VS 보다 하위 버전의 프로젝트인 경우는 알아서 Skip 하고 진행됨.

“2”개의 인수가 있는 “AddFromFile”을(를) 호출하는 동안 예외가 발생했습니다. “프로젝트 파일 ‘C:Program Files (x86)ComponentOne Studio.NET 2.0C1FlexGridSamplesCSThemesThemes.csproj’은(는) 이전 버전의 응용 프로그램에서 만들어졌으므로 변환해야 합니
다.”
위치 줄:1 문자:67
+ (ls $pjtDir -Recurse t*.csproj) | % { $dteObj.Solution.AddFromFile <<<< ($_.FullName, $true) }
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ComMethodTargetInvocation

 

모두 추가할려면 개별 프로젝트를 일일이 변환 한 다음 추가해 줘야함

  -> 아래 스샷을 보면 변환 이 무슨 의미인지 알겠지?? ( 나중에 혹시 헷갈리지 않을까 해서리.. )

C1 Sample 이 빌드된 Binary 도 없는 데다가 샘플도 각각 열어서 직접 빌드한 다음 확인하는게 넘 불편해서리
 
솔루션 하나로 쉽게 묶을 방법을 찾다가.........
 
VS Extension 이 있을까해서 찾아봤지만 없네? 예전에 본것 같은데.. 현재로써는 검색 실패!!.........
 
add multiple existing project to Solution 으로 구글링하다가 발견
 
참조 경로 : http://stackoverflow.com/questions/1891035/easy-way-to-add-multiple-existing-csproj-to-a-visual-studio-solution
 
편의를 위해 VS 2010 에 PowerConsole Extension 설치 후
 
PowerConsole 창에서 다음을 실행(참조 경로의 내용에서 살짝만 수정함)
$scriptDirectory = "D:\KKOMZI\Code_Test\C1Samples"$dteObj = [System.Activator]::CreateInstance([System.Type]::GetTypeFromProgId("VisualStudio.DTE"))
$slnDir = ".\"$slnName = "All"$pjtDir = "C:\Program Files (x86)\ComponentOne Studio.NET 2.0\C1FlexGrid\Samples\CS"
$dteObj.Solution.Create($scriptDirectory, $slnName)(ls $pjtDir -Recurse *.csproj) | % { $dteObj.Solution.AddFromFile($_.FullName, $false) }
$dteObj.Solution.SaveAs( (Join-Path $scriptDirectory 'All.sln') ) 
$dteObj.Quit()
출처: https://kkomzi.tistory.com/247 [Be well-being !!:티스토리]
솔루션 파일 경로와 프로젝트를 로딩할 경로를 각각 지정해서
지정된 폴더 하위의 프로젝트들을 솔루션 하나로 묶어줌.
 
VS2010 에서 테스트 해보니 현재 VS 보다 하위 버전의 프로젝트인 경우는 알아서 Skip 하고 진행됨.
"2"개의 인수가 있는 "AddFromFile"을(를) 호출하는 동안 예외가 발생했습니다. "프로젝트 파일 'C:\Program Files (x86)\ComponentOne Studio.NET 2.0\C1FlexGrid\Samples\CS\Themes\Themes.csproj'은(는) 이전 버전의 응용 프로그램에서 만들어졌으므로 변환해야 합니다."
위치 줄:1 문자:67
+ (ls $pjtDir -Recurse t*.csproj) | % { $dteObj.Solution.AddFromFile <<<< ($_.FullName, $true) }
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ComMethodTargetInvocation
모두 추가할려면 개별 프로젝트를 일일이 변환 한 다음 추가해 줘야함
  -> 아래 스샷을 보면 변환 이 무슨 의미인지 알겠지?? ( 나중에 혹시 헷갈리지 않을까 해서리.. )

TAG INFORMATION

Learn more on this topic

Related Blog Posts

Join in the conversation

Leave a Comment

0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

무료 온라인 전광판

전광판

텍스트를 입력하고 텍스트 효과 및 배경효과 를 변경해서 전체화면으로 표시할 수 있는 전광판 용도로 사용하실 수 있습니다. 각종 스포츠 및 공연 관람시 응원 용도로 사용이 가능합니다.

Carousel

여러개의 슬라이드를 추가하여 프레젠테이션 및 이미지 슬라이드 용도로 사용하실 수 있습니다. 브라우저가 포함된 IT 기기로 큰 모니터에 연결하여 매장 내 공지사항 및 메뉴소개를 이미지로 표시할 수 있습니다.

Pin It on Pinterest

Shares
Share This

Share This

Share this post with your friends!

Shares