your programing

Visual Studio에서 솔루션 빌드, 솔루션 다시 빌드 및 솔루션 정리의 차이점은 무엇입니까?

lovepro 2020. 9. 27. 13:29
반응형

Visual Studio에서 솔루션 빌드, 솔루션 다시 빌드 및 솔루션 정리의 차이점은 무엇입니까?


Visual Studio에서 솔루션 빌드, 솔루션 다시 빌드 및 솔루션 정리의 차이점은 무엇입니까?

이들 각각을 사용하기에 적절한시기는 언제입니까?


  • 빌드 솔루션 은 증분 빌드를 수행합니다 . 프로젝트를 다시 빌드 할 필요 가 없다고 생각 하면 그렇지 않습니다. 변경되지 않은 경우 프로젝트의 부분적으로 빌드 된 비트를 사용할 수도 있습니다 (얼마까지 걸리는지 모르겠습니다).
  • Rebuild solution 은 정리 한 다음 처음부터 솔루션을 빌드하고 이전에 수행 한 작업을 무시합니다. 이것과 "Clean, then Build"의 차이점은 Rebuild가 모든 프로젝트를 정리 한 다음 모두 빌드하는 것이 아니라 한 번에 하나씩 각 프로젝트를 정리 한 다음 빌드한다는 것입니다.
  • 깨끗한 솔루션 은 이전 빌드에서 빌드 아티팩트를 제거합니다. 빌드 대상 디렉토리 (bin 및 obj)에 다른 파일이있는 경우 제거되지 않을 수 있지만 실제 빌드 아티팩트는 제거됩니다. 나는 이것에 대한 행동이 다양하다는 것을 보았습니다-때로는 상당히 철저히 삭제하고 때로는 그렇지 않습니다-그러나 나는 VS에 당분간 의심의 이점을 줄 것입니다 :)

(링크는 devenv.exe 명령 줄 스위치에 대한 것이지만 메뉴 항목과 동일합니다.)


솔루션 빌드 : 변경된 코드 파일 (DLL 및 EXE)을 컴파일합니다.

다시 빌드 : 모든 컴파일 된 파일을 삭제하고 코드 변경 여부에 관계없이 다시 컴파일합니다.

클린 솔루션 : 컴파일 된 모든 파일 (DLL 및 EXE 파일)을 삭제합니다.

이 YouTube 비디오 ( Visual Studio Build vs. Rebuild vs. Clean (C # 인터뷰 질문 및 답변) )를 볼 수 있습니다. 여기에서 차이점을 설명했으며 아래는 동일한 내용을 더 자세히 분석하는 데 도움이되는 시각적 표현입니다.

빌드 vs 리빌드

Rebuild와 (Clean + Build)의 차이점은 이것에 대해서도 약간의 혼란이 있기 때문입니다.

차이점은 모든 프로젝트에서 빌드 및 정리 시퀀스가 ​​발생하는 방식입니다. 솔루션에 "proj1"과 "proj2"라는 두 개의 프로젝트가 있다고 가정 해 보겠습니다. 다시 빌드하면 "proj1"이 필요하고 "proj1"용으로 컴파일 된 파일을 정리 (삭제)하고 빌드합니다. 그 후 두 번째 프로젝트 인 "proj2"를 가져 와서 "proj2"용으로 컴파일 된 파일을 정리하고 "proj2"를 컴파일합니다.

그러나 "clean"및 build "를 수행하면 먼저"proj1 "및"proj2 "에 대해 컴파일 된 모든 파일을 삭제 한 다음"proj1 "을 빌드 한 다음"proj2 "를 빌드합니다.

다시 빌드 대 정리


이 링크 에서 가져옴 :

빌드는 마지막 빌드 이후 변경된 소스 파일 만 컴파일하고 링크하는 것을 의미하고, Rebuild는 변경 여부에 관계없이 모든 소스 파일을 컴파일하고 링크하는 것을 의미합니다. 빌드는 일반적인 작업이며 더 빠릅니다. 프로젝트 대상 구성 요소의 버전이 동기화되지 않을 수 있으며 빌드를 성공적으로 수행하려면 다시 빌드해야합니다. 실제로는 청소할 필요가 없습니다.


솔루션 빌드 -파일이 변경된 어셈블리를 빌드합니다. 어셈블리에 변경 사항이 없으면 다시 작성되지 않습니다. 또한 중간 파일을 삭제하지 않습니다.

가장 일반적으로 사용됩니다.

Rebuild Solution - Rebuilds all assemblies regardless of changes but leaves intermediate files.

Used when you notice that Visual Studio didn't incorporate your changes in the latest assembly. Sometimes Visual Studio does make mistakes.

Clean Solution - Delete all intermediate files.

Used when all else fails and you need to clean everything up and start fresh.


I just think of Rebuild as performing the Clean first followed by the Build. Perhaps I am wrong ... comments?


Build Solution – Builds any assemblies which have changed files. If an assembly has no changes, it won’t be re-built. Also will not delete any intermediate files.

Rebuild solution will clean and then build the solution from scratch, ignoring anything it’s done before

Clean Solution will delete all compiled files (i.e., EXE’s and DLL’s) from the bin/obj directory.


Build solution will build any projects in the solution that have changed. Rebuild builds all projects no matter what, clean solution removes all temporary files ensuring that the next build is complete.


Build Solution - Build solution will build your application with building the number of projects which are having any file change. And it does not clear any existing binary files and just replacing updated assemblies in bin or obj folder.

Rebuild Solution - Rebuild solution will build your entire application with building all the projects are available in your solution with cleaning them. Before building it clears all the binary files from bin and obj folder.

Clean Solution - Clean solution is just clears all the binary files from bin and obj folder.


The one major thing I think people are leaving out is that Build and Clean are both tasks that are performed based on Visual Studio's knowledge of your Project/Solution. I see a lot of complaining that Clean doesn't work or leaves leftover files or is not trustworthy, when in fact, the reasons you say it isn't trustworthy actually makes it more trustworthy.

Clean will only remove (clean) files and/or directories that Visual Studio or the compiler themselves have in fact created. If you copy your own files or files/folder structures get created from an outside tool or source, then Visual Studio doesn't "know they exist" and therefore, should not touch them.

Can you imagine if the Clean operation basically performed a "del *.*" ? This could be catastrophic.

Build performs a compile on changed or necessary projects.

Rebuild performs a compile regardless of change or what's necessary.

Clean removes files/folders it has created in the past, but leaves anything that it didn't have anything to do with, initially.

I hope this elaborates a bit and helps.


Build solution

This will perform an incremental build. In other words it will only build code files which have changed. If they have not changed those files will not be touched.

Rebuild solution

This will delete all currently compiled files (i.e., exe and DLLs) and will build everything from scratch, irrespective of if there is code change in the file or not.

Clean solution menu

This menu will delete all compiled files (i.e., EXE’s and DLL’s) from the bin/obj directory.

Rebuild = Clean + Build


Build solution only builds those projects which have changed in the solution, and does not effect assemblies that have not changed,

ReBuild first cleans, all the assemblies from the solution and then builds entire solution regardless of changes done.

Clean, simply cleans the solution.


내가 아는 것은 Clean은 "make clean"이 사용하던 작업을 수행하지 않는다는 것입니다. 솔루션을 청소하면 obj 및 bin 파일 / 폴더를 삭제하여 소스를 새로 확인하는 것입니다. 내 경험상 종종 Clean and Build 또는 Rebuild 가 컴파일 하는 것으로 알려진 소스에서 이상한 오류를 생성 하고 필요한 것은 bin / obj 폴더를 수동으로 삭제하는 경우가 많지만 빌드됩니다.

참고 URL : https://stackoverflow.com/questions/3095901/difference-between-build-solution-rebuild-solution-and-clean-solution-in-visua

반응형