블로그 이미지
생각처럼

카테고리

전체보기 (209)
TOOL (1)
다이어리 (1)
Bit (200)
HELP? (0)
Total
Today
Yesterday

달력

« » 2025.2
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28

공지사항

태그목록

최근에 올라온 글

출처 Most Valuable Person | 이호주니
원문 http://blog.naver.com/truhojun/40034462447

내용 요약

 

MFC로 작성한 DLL을 사용하는 C# Application을 완성하여 개발 PC에서는 잘 사용하고 있었다. 그러나 재배포를 위해 Setup Project를 만들고 배포 가능한 패키지를 만들어 Visual Studio 2005가 설치되어 있지 않은 다른 PC에서 인스톨하여 실행한 결과 런타임시 HRESULT: 0x800736B1에러가 뜨면서 예외가 발생하였다

 

해결방법

배포판을 만드는 방법은 두가지가 있다

 

    1. Visual Studio의 Deployment Project를 이용하여 배포판 패키지 작성

    2. XCopy Deployment

 

2번 방법은 manifest-base binding을 지원하는 Windows XP Home Edition, Windows XP Professional, Windows Server 2003에서만 사용 가능하고, XP이전의 운영체제에서는 반드시 1번 방법을 사용하여야 한다

 

다음은 배포판 패키지를 작성하는 방법이다(해석하기 귀찮아 MSDN을 복사하였다)

 

1. From the Project menu, choose Add and click File.

 

2. Find the folder containing MyApplication.exe and MyLibrary.DLL and select them both.

 

3. In the File System window, right click on Application Folder, point to Add and clickCreate to create a new folder. Call it MyLibrary.

 

4. Click on Application Folder again, select MyLibrary.DLL and drag it to the MyLibrary folder.In Solution Explorer, under your project in Detect Dependencies you should see that the Visual Studio detects dependencies on MFC80.dll and MSVCR80.dll. You need to add the corresponding Merge Modules for these DLLs.

 

5. From the Project menu, point to Add and click Merge Module. Select Microsoft_VC80_CRT_x86.msm and Microsoft_VC80_MFC_x86.msm, and click OK.

(The debug versions of these merge modules are named Microsoft_VC80_DebugCRT_x86.msm and Microsoft_VC80_DebugMFC_x86.msm.

For deploying 64-bit applications to a 64-bit operating system, select the merge module for the corresponding platform. For x64, select Microsoft_VC80_CRT_x86_x64.msm and Microsoft_VC80_MFC_x86_x64.msm; for Itanium, Microsoft_VC80_CRT_x86_ia64.msm and Microsoft_VC80_MFC_x86_ia64.msm.

)

 

이렇게 설정한 후 빌드하면 Installable 화일이 생기고, 배포후 설치하면 된다

 

이래도 안되면 MSDN에 나와있는 아래와 같은 방법으로 해보기 바란다

 

위에서와 같이 패키지 Project를 만들고

 

1. From the Project menu, choose Add and click File.

 

2. Find the folder containing MyApplication.exe and MyLibrary.DLL and select them both.

 

3. In the File System window, right click Application Folder, point to Add and click Createto create a new folder. Call it MyLibrary.

 

4. Click Application Folder again, select MyLibrary.DLL and drag it to the MyLibrary folder.InSolution Explorer, under your project in Detect Dependencies you should see that Visual Studio detects dependencies on MFC80.dll and MSVCR80.dll. You need to add a corresponding folder for these assemblies from the \vc\redist folder.

 

5. Open %PROGDIR%\Microsoft Visual Studio 8\VC\Redist\x86 in Windows Explorer.

 

6. Holding the Ctrl key, click the folders Microsoft.VC80.CRT and Microsoft.VC80.MFC. Drag these folders to Visual Studio and drop them into the Application folder.

 

7. Repeat step 7, but this time drag the folders to the MyLibrary folder.

    You may see a message from Visual Studio saying that you are including a DLL that is part of a Merge Module. This is exactly what you want to do, so click No to indicate that you do not want to use an MSM for this DLL.

    You need mfcm80.dll and its Unicode version mfcm80u.dll only if you use MFC/Winforms integration. Otherwise you can remove these DLLs from your setup.

    You need msvcm80.dll only if you are using managed code in your applications, for example, if your projects are built with /clr or /clr:pure.

    If mfcm80.dll, mfcm80u.dll, or msvcm80.dll is included in the setup project, an installation of the .NET Framework is required. Your setup won't work without .NET Framework 2.0 installed on the target machine.

    For debug installation, change CRT to DebugCRT and MFC to DebugMFC in the previous step.

    For deploying 64-bit applications to 64-bit operating systems, use \vc\redist\amd64 or \vc\redist\ia64.

 

그런데.....

 

나같은 경우 위의 두가지 방법다 통하지 않았다

 

그래서 끈질긴 검색 끝에 찾아낸 방법은 Release Version으로 배포하는것..

이때 DLL 프로젝트 속성에서 구성속성->매니패스트도구->어셈블리 ID를 2로 바꿔줘야 한다

(이때 주의할 것은 다시 개발을 위해 디버깅 모드로 돌아가면 어셈블리 ID를 공백으로 두어야 한다)

 

거기에 \Program Files\Microsoft Visual Studio8\Sdk\v2.0BootStrapper\Packages\vcredist_x86에 있는 vcredist_x86.exe까지 같이 배포하여 설치하여 주면 문제가 없을 것이다.

이 구성요소를 패키지 프로젝트에 포함 시킬때는

패키지 프로젝트의 속성에서 필수 구성요소를 클릭하여 Visual C++ 런타임 라이브러리(x86)을 체크하여주면 설치시 같이 설치된다

 

Reference

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=166919&SiteID=1

http://msdn2.microsoft.com/en-us/library/aa985617(VS.80).aspx

http://msdn2.microsoft.com/en-us/library/ms235317(VS.80).aspx

Posted by 생각처럼
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함