Visual C#¿¡¼­ Àü¿ª ¾î¼Àºí¸® ij½Ã¿¡ ¾î¼Àºí¸®¸¦ ¼³Ä¡ÇÏ´Â ¹æ¹ý

±â¼ú ÀÚ·á: 815808 - ÀÌ ¹®¼­°¡ Àû¿ëµÇ´Â Á¦Ç° º¸±â.
¸ðµÎ È®´ë | ¸ðµÎ Ãà¼Ò

ÀÌ ÆäÀÌÁö¿¡¼­

¿ä¾à

ÀÌ ¹®¼­¿¡¼­´Â ¾î¼Àºí¸®¿¡ ´ëÇØ °­·ÂÇÑ À̸§À» »ý¼ºÇϰí Àü¿ª ¾î¼Àºí¸® ij½Ã(GAC)¿¡ DLL ÆÄÀÏÀ» ¼³Ä¡ÇÏ´Â ¹æ¹ýÀ» ¼³¸íÇÕ´Ï´Ù. GAC¸¦ »ç¿ëÇÏ¸é ¿©·¯ ÀÀ¿ë ÇÁ·Î±×·¥¿¡¼­ ¾î¼Àºí¸®¸¦ °øÀ¯ÇÒ ¼ö ÀÖ½À´Ï´Ù. GAC´Â .NET ·±Å¸ÀÓ°ú ÇÔ²² ÀÚµ¿À¸·Î ¼³Ä¡µË´Ï´Ù. ±¸¼º ¿ä¼Ò´Â ´ë°³ C:\WINNT\Assembly¿¡ ÀúÀåµË´Ï´Ù.

GAC¿¡ ¾î¼Àºí¸®¸¦ ¼³Ä¡ÇÏ·Á¸é ¾î¼Àºí¸®¿¡ °­·ÂÇÑ À̸§À» ºÎ¿©ÇØ¾ß ÇÕ´Ï´Ù. À̸§Àº ¾Ïȣȭ ÇØ½Ã Ű ¶Ç´Â ¼­¸í¿¡ ÇØ´çÇÕ´Ï´Ù. °­·ÂÇÑ À̸§Àº ¿Ã¹Ù¸¥ ±¸¼º ¿ä¼Ò ¹öÀü °ü¸®¸¦ º¸ÀåÇÕ´Ï´Ù. ÀÌ·¸°Ô ÇÏ¸é µ¿ÀÏÇÑ À̸§À» °¡Áø ±¸¼º ¿ä¼ÒµéÀÌ ¼­·Î Ãæµ¹Çϰųª ¼Ò¸ð¼ºÀÌ ³ôÀº ÀÀ¿ë ÇÁ·Î±×·¥¿¡¼­ À߸ø »ç¿ëµÇ´Â °ÍÀ» ¹æÁöÇÏ´Â µ¥ µµ¿òÀÌ µË´Ï´Ù.


¿ä±¸ »çÇ×

´ÙÀ½Àº ±ÇÀåµÇ´Â Çϵå¿þ¾î, ¼ÒÇÁÆ®¿þ¾î ¹× ³×Æ®¿öÅ© ÀÎÇÁ¶ó¿Í ÇÊ¿äÇÑ ¼­ºñ½º ÆÑÀÇ ¸ñ·ÏÀÔ´Ï´Ù.
  • °øÀ¯ ¾î¼Àºí¸®°¡ ¼³Ä¡µÉ ÄÄÇ»ÅÍ¿¡ ´ëÇÑ °ü¸®ÀÚ ±ÇÇÑ

ÀÌ ¹®¼­¿¡¼­´Â »ç¿ëÀÚ°¡ ´ÙÀ½ ³»¿ëÀ» Àß ¾Ë°í ÀÖ´Â °ÍÀ¸·Î °¡Á¤ÇÕ´Ï´Ù.
  • .NET ¶Ç´Â Visual Studio 2005ÀÇ ¾î¼Àºí¸®¿¡ ´ëÇÑ ÀÏ¹Ý Áö½Ä
  • ¸í·É ÇÁ·ÒÇÁÆ®¿¡¼­ µµ±¸¸¦ »ç¿ëÇÏ´Â ¹æ¹ý¿¡ ´ëÇÑ ÀÏ¹Ý Áö½Ä

Àü¿ª ¾î¼Àºí¸® ij½Ã

Visual Studio .NET ¶Ç´Â Visual Studio 2005¸¦ »ç¿ëÇÏ¿© ¼Ò±Ô¸ð Ŭ·¡½º ¶óÀ̺귯¸® ÇÁ·ÎÁ§Æ®¸¦ ¸¸µé°í, °­·ÂÇÑ À̸§À» »ý¼ºÇϰí, ÇÁ·ÎÁ§Æ®ÀÇ .dll ÆÄÀÏÀ» GAC¿¡ ¼³Ä¡ÇÏ·Á¸é ´ÙÀ½°ú °°ÀÌ ÇϽʽÿÀ.
  1. Visual Studio .NET ¶Ç´Â Visual Studio 2005¿¡¼­ Visual C# Ŭ·¡½º ¶óÀ̺귯¸® ÇÁ·ÎÁ§Æ®¸¦ »õ·Î ¸¸µé°í ÇÁ·ÎÁ§Æ®ÀÇ À̸§À» GACDemo·Î ÁöÁ¤ÇÕ´Ï´Ù.
  2. °­·ÂÇÑ À̸§À» »ç¿ëÇØ¾ß ÇÕ´Ï´Ù. ÀÌ ¾Ïȣȭ Ű ½ÖÀ» ¸¸µé·Á¸é SN µµ±¸¸¦ »ç¿ëÇÕ´Ï´Ù. ÀÌ µµ±¸´Â .NET Framework SDK(Solution Developer Kit)°¡ ¼³Ä¡µÈ \bin ÇÏÀ§ µð·ºÅ͸®¿¡ ÀÖ½À´Ï´Ù. SN µµ±¸´Â »ç¿ëÇϱⰡ ½±½À´Ï´Ù. ¸í·ÉÁÙ ¸í·É¹®ÀÇ Çü½ÄÀº ¾Æ·¡¿Í °°½À´Ï´Ù.
    form:sn -k "[DriveLetter]:\[DirectoryToPlaceKey]\[KeyName].snk"
  3. ۸¦ ½±°Ô ã°í ¸í·É ÇÁ·ÒÇÁÆ®¿¡¼­ Ű¿¡ ½±°Ô ¾×¼¼½ºÇÒ ¼ö ÀÖµµ·Ï C:\¿¡ GACKey µð·ºÅ͸®¸¦ ¸¸µì´Ï´Ù.

    Âü°í?´ëºÎºÐÀÇ °æ¿ì .NET µµ±¸´Â C:\Program Files\Microsoft.NET\FrameworkSDK\Bin¿¡ ÀÖ½À´Ï´Ù. ´ÙÀ½ SN ¸í·ÉÀ» ÀÔ·ÂÇϱâ Àü¿¡ ÀÌ¿Í À¯»çÇÑ ÄÄÇ»ÅÍÀÇ °æ·Î¸¦ .NET bin µð·ºÅ͸®¿¡ º¹»çÇÒ ¼öµµ ÀÖ½À´Ï´Ù. ¸í·É ÇÁ·ÒÇÁÆ®¿¡ cd¸¦ ÀÔ·ÂÇϰí, °æ·Î¸¦ ¸¶¿ì½º ¿À¸¥ÂÊ ´ÜÃß·Î ´­·¯ ºÙ¿© ³ÖÀº ´ÙÀ½ Enter ۸¦ ´­·¯ SN µµ±¸°¡ ÀÖ´Â µð·ºÅ͸®¸¦ º¯°æÇÕ´Ï´Ù.

    ´ÙÀ½°ú °°ÀÌ ÀÔ·ÂÇÕ´Ï´Ù.
    sn -k "C:\GACKey\GACkey.snk"
  4. ۰¡ »ý¼ºµÇÁö¸¸ ¾ÆÁ÷ ÇÁ·ÎÁ§Æ®ÀÇ ¾î¼Àºí¸®¿Í ¿¬°áµÇ¾î ÀÖÁö ¾Ê½À´Ï´Ù. ¿¬°áÇÏ·Á¸é Visual Studio .NET ¼Ö·ç¼Ç Ž»ö±â¿¡¼­ AssemblyInfo.cs ÆÄÀÏÀ» µÎ ¹ø ´©¸¨´Ï´Ù. ÀÌ ÆÄÀÏ¿¡´Â Visual Studio .NET¿¡¼­ ÇÁ·ÎÁ§Æ®¸¦ ¸¸µé ¶§ ±âº»ÀûÀ¸·Î Æ÷ÇԵǴ ¾î¼Àºí¸® Ư¼º ¸ñ·ÏÀÌ ÀÖ½À´Ï´Ù. ´ÙÀ½°ú °°ÀÌ Äڵ忡¼­ AssemblyKeyFile ¾î¼Àºí¸® Ư¼ºÀ» ¼öÁ¤ÇÕ´Ï´Ù.
    [assembly: AssemblyKeyFile("C:\\GACKey\\GACKey.snk")]
    Ctrl+Shift+B¸¦ ´­·¯ ÇÁ·ÎÁ§Æ®¸¦ ÄÄÆÄÀÏÇÕ´Ï´Ù. GAC¿¡ .dll ÆÄÀÏÀ» ¼³Ä¡ÇÏ´Â µ¥ Ãß°¡ ÄÚµå´Â ÇÊ¿äÇÏÁö ¾Ê½À´Ï´Ù.
  5. Gacutil µµ±¸¸¦ »ç¿ëÇϰųª .dll ÆÄÀÏÀ» ÀûÀýÇÑ µð·ºÅ͸®·Î ²ø¾î .dll ÆÄÀÏÀ» ¼³Ä¡ÇÒ ¼ö ÀÖ½À´Ï´Ù. Gacutil µµ±¸¸¦ »ç¿ëÇÏ´Â °æ¿ì¿¡´Â ¾Æ·¡ÀÇ ¸í·ÉÀ» »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
    gacutil -I "[DriveLetter]:\[PathToBinDirectoryInVSProject]\gac.dll"
    ÆÄÀÏÀ» ²ø·Á¸é Microsoft Windows Ž»ö±â¸¦ »ç¿ëÇÕ´Ï´Ù. Windows Ž»ö±â¸¦ µÎ °³ ¿±´Ï´Ù. ÇÑ Å½»ö±â¿¡¼­ ÇØ´ç ÄÜ¼Ö ÇÁ·ÎÁ§Æ®¿¡ ´ëÇÑ .dll ÆÄÀÏ Ãâ·Â À§Ä¡¸¦ ã½À´Ï´Ù. ´Ù¸¥ Ž»ö±â¿¡¼­´Â c:\[SystemRoot]\Assembly¸¦ ã½À´Ï´Ù.

    .dll ÆÄÀÏÀ» Assembly Æú´õ·Î ²ü´Ï´Ù.

Àüü ÄÚµå ¿¹Á¦(AssemblyInfo.cs)

using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// that is associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly is made up of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values, or you can default the revision and build numbers 
// by using the '*' as shown below:

[assembly: AssemblyVersion("1.0.*")]

//
// To sign your assembly you must specify a key to use. See the 
// Microsoft .NET Framework documentation for more information about assembly signing.
//
// Use the following attributes to control that key is used for signing. 
//
// Notes: 
//   (*) If no key is specified, the assembly is not signed.
//   (*) KeyName refers to a key that has been installed in the Crypto Service
//       Provider (CSP) on your computer. KeyFile refers to a file that contains
//       a key.
//   (*) If the KeyFile and the KeyName values are both specified, the 
//       following processing occurs:
//       (1) If the KeyName can be found in the CSP, that key is used.
//       (2) If the KeyName does not exist and the KeyFile does exist, the key 
//           in the KeyFile is installed to the CSP and used.
//   (*) To create a KeyFile, you can use the sn.exe (Strong Name) utility.
//       When specifying the KeyFile, the location of the KeyFile must be
//       relative to the project output directory which is
//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
//       located in the project directory, you would specify the AssemblyKeyFile 
//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
//       documentation for more information about this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("C:\\GACKey\\GACKey.snk")]
[assembly: AssemblyKeyName("")]

È®ÀÎ

  1. Windows Ž»ö±â¸¦ ½ÃÀÛÇÕ´Ï´Ù.
  2. C:\SystemRoot\ assembly¸¦ ã½À´Ï´Ù.
  3. ¼³Ä¡µÇ¾î ÀÖ´Â .dll ÆÄÀÏ ¸ñ·Ï¿¡¼­ GACDemo¸¦ º¾´Ï´Ù.

ÂüÁ¶

ÀÚ¼¼ÇÑ ³»¿ëÀº ´ÙÀ½ Microsoft À¥ »çÀÌÆ®¸¦ ÂüÁ¶ÇϽʽÿÀ.
Àü¿ª ¾î¼Àºí¸® ij½Ã¿¡ ¾î¼Àºí¸® ¼³Ä¡
http://msdn2.microsoft.com/en-us/library/dkkx7f79(vs.71).aspx(¿µ¹®)
Àü¿ª ¾î¼Àºí¸® ij½Ã
http://msdn2.microsoft.com/en-us/library/yf1d93sz(vs.71).aspx(¿µ¹®)
Àü¿ª ¾î¼Àºí¸® ij½Ã µµ±¸
http://msdn2.microsoft.com/en-us/library/ex0ss12c(vs.71).aspx(¿µ¹®)




Microsoft Á¦Ç° °ü·Ã ±â¼ú Àü¹®°¡µé°ú ¿Â¶óÀÎÀ¸·Î Á¤º¸¸¦ ±³È¯ÇϽ÷Á¸é Microsoft ´º½º ±×·ì¿¡ Âü¿©ÇϽñ⠹ٶø´Ï´Ù.

¼Ó¼º

±â¼ú ÀÚ·á: 815808 - ¸¶Áö¸· °ËÅä: 2007³â 5¿ù 13ÀÏ ÀÏ¿äÀÏ - ¼öÁ¤: 3.7
º» ¹®¼­ÀÇ Á¤º¸´Â ´ÙÀ½ÀÇ Á¦Ç°¿¡ Àû¿ëµË´Ï´Ù.
  • Microsoft Visual C# 2005
  • Microsoft Visual C# .NET 2003 Standard Edition
  • Microsoft Visual C# .NET 2002 Standard Edition
  • Microsoft ASP.NET 1.0
  • Microsoft ASP.NET 1.1
Ű¿öµå:?
kbcodesign kbcommandline kbnamespace kbhowtomaster KB815808

Çǵå¹é º¸³»±â