??? ??????? ??? ??????? ??????? ??? ??? ????? C# ?? ??????? ???? ?? ??? ???? ????

???? ?????? ???? ??????
???? ID: 815808 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
??? ?? ??????? ???? | ??? ?? ??????? ????

?? ????? ??

??????

?? ???? ????? ???? ?? ?? ?? ??????? ?? ??? ??? ??????? ??? ????? ???? ?? ??? ???? ????, ?? ???. dll ????? ??? ??????? ??????? ??? (GAC) ??????? ???? ?? ??? ???? ????? GAC ?? ??? ?? assemblies ?? ?? ????????? ?? ??? ???? ?? ????? .NET ?????? ?? ??? GAC ???????? ??? ?? ??????? ??? ??? ?????????? C:\WINNT\Assembly ??? ???????? ????

GAC ??? ?? ??????? ?? ??????? ???? ?? ??? ???? ??? ???? ?????? ??????? ?? ?????? ??????????????? ???-?????, ?? ????????? ??? ??? ?? ??? ?? ????? ??? ??? versioning ????????? ???? ??? ?? ??? ??? ???? ?? ??-????? ?? ??? conflicting ?? ?? ??? ????? ?? ??? consuming ????????? ?????? ????? ??? ???? ?? ??? ???? ???


??????????

????? ???? outlines ???????? ?????????, ??????????, ??????? ?????? ?? ?????? ??? ?? ???? ???:
  • ???? ???? ??????? ??????? ???? ?? ??? ?? ???????? ?????????? ??????

?? ???? ????? ?? ?? ?? ????? ???? ?? ?????? ???:
  • .NET ??? assemblies ?? ??? ??????? familiarity.
  • ????? ????????? ?? ????? ?? ????? ???? ?? ??? ??????? familiarity.

??????? ??????? ???

?? ????? ??? ????? ???? ?? ???, ?? GAC ??? ????????? ??. dll ????? ?? ??????? ???? ?? ??? Visual Studio, ?? ????? ?? ?? ???? ????? ????????? ????????? ?????, ?? ????? ?? ???? ????:
  1. ??? ??? ????? C# ???? ?? ????? ??? Visual Studio ????????? ????????? ?? ????????? ?? ???GACDemo.
  2. ?? ?? ????? ??? ?? ????? ???? ?????? ?? ???????????????? ????? ???? ?????, SN ????? ?? ????? ????? ?? ????? ?? \bin subdirectory ???? .NET Framework ?????? ?????? ??? (SDK) ??????? ?? ??? ????? ??? SN ????? ?? ????? ???? ??? ????-?????? ??? ????? ???? ??
    "[DriveLetter]:\[DirectoryToPlaceKey]\[KeyName].snk" SN -k
    ???:Visual Studio 2005 ??? ?? Visual Studio ?? ??? ?? ????????? ???, ?? ???? ?? ????? ????? ???? ?? ???? ??????? ??? ???? ?? ???? ?? ??? IDE ????????? ??? ????? ?? ???? ???? ???? ???, ?? ?? ???? ??? ??? 3 ?? 4 ??? ?? ???? ?? ?? AssemblyInfo.cs ????? ?? ??? ??? ??? ???????? ??????

    ???? ????? ???? ????? ???? ?? ???? ??????? ??? ???? ?? ???? ?? ??? IDE ????????? ??? ?? ????? ????, ????? ????? ?? ???? ????:
    1. ?????? Explorer ???, ???? ?????GACDemo?? ????-????? ????, ?? ???? ??????.
    2. ????? ????????????????, ?? ???? ??? ?? ??? ???? ?? ??? ????? ??????????? ???? ?? ??????? ?????.
    3. ??????? ????? ??? ????? ?? ??? ????????, ????? ????<new...></new...>.
    4. ??????:GACkey.snk?? ??? ??? ????? ????? ??? ????? ???? ???? ?? ??????? ????? ????? ?? ?? ??????? ?? ???????? ???????????? ?? ????? ?? ??? ????? ????, ?? ???? ???OK.
    5. ????????? ?? ?????? ???? ?? ??? CTRL + SHIFT + B ??????
    ?? ????? ????? ?? ???? ???? ?? ??? ???? ?? ??? ?? ???? ???? ??? 5 ??? GAC ???? ??????? ??????? ???? ?? ????
  3. ???? ?????????? ?? ??? ?????GACKey??? C:\ ???? ?? ?? ???? ??? ????? ?? ????? ?? ?????? ?????, ?? ????? ????????? ?? ????? ??? ???????

    ???:??????? ???????????? ?? ???, .NET ????? ??? ????? ??? C:\Program Files\Microsoft.NET\FrameworkSDK\Bin. ???? ???? ?? ?? ????? SN ???? ???? ????, ???? .NET ??? ?????????? ?? ??? ???? ???????? ?? ?? ??? ?? ?? ????????? ????? ????? ?? ???? ??? ??????:CD????? ????????? ?? ?? ??????? ?? ??? ????-????? ????, ?? ???? SN ????? ????? ?? ?????????? ?? ???? ?? ????? ?? ??? ENTER ??????

    ????? ?????:
    "C:\GACKey\GACkey.snk" SN -k
  4. ???? ????? ????? ???? ??? ??, ????? ?? ???? ?? ??? ?? ??????? ????????? ?? ??? ?????? ??? ?? ????? ?????, AssemblyInfo.cs ????? Visual Studio .NET ?????? Explorer ??? ???-????? ????? ?? ????? ?? ???????? ??? ?? ????? ??? ?? ??? ????????? Visual Studio .NET ??? ????? ??? ?? ?? ??????? ????????? ?? ???? ??? ??????? ????AssemblyKeyFile??????? ??????? ??? ??? ?? ??? ???:
    [???????: AssemblyKeyFile("C:\\GACKey\\GACKey.snk")]
    CTRL + SHIFT + B ???? ????????? ?? ??????? ????? ?? GAC ??? ???. dll ????? ?? ??????? ???? ?? ??? ??? ?? ???????? ??? ?? ??? ???? ???
  5. Gacutil ????? ?? ????? ?? ?? ??????? ??????? ?? ???. dll ????? ?? ???? ?? ??. dll ????? ?? ??????? ?? ????? ??? ?? Gacutil ?? ????? ????, ????? ????? ?? ???? ??? ?? ????? ?? ???? ?? ????:
    gacutil - ??? "[DriveLetter]:\[PathToBinDirectoryInVSProject]\gac.dll"
    ????? ?? ?? ??????, ?? ??? Windows Explorer ?? ?? ?????????? ?? ?????? ?? ?????? ??? ???? ????? ????????? ?? ???. dll ????? ?????? ?? ????? ??????? ???? ?????? ???, c:\[SystemRoot]\Assembly ??????? ??, ????. dll ????? ?? ???? ?? ??? ????????????????????.

??????? ????? ??? (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 Explorer ??????? ????..
  2. C:\ ??????Systemroot\ ????????
  3. ???????. dll ??????? ?? ???? ??? GACDemo ??????

??????

???? ??????? ?? ???, ????? Microsoft ??? ???? ?????:
??????? ??????? ??? ??? ??? ??????? ??????? ?? ??? ??
(vs.71) http://msdn2.Microsoft.com/en-us/library/dkkx7f79 .aspx
??????? ??????? ???
(vs.71) http://msdn2.Microsoft.com/en-us/library/yf1d93sz .aspx
??????? ??????? ??? ?????
(vs.71) http://msdn2.Microsoft.com/en-us/library/ex0ss12c .aspx

???

???? ID: 815808 - ????? ???????: 30 ??????? 2010 - ??????: 4.0
???? ???? ???? ??:
  • Microsoft Visual C# 2008 Express Edition
  • Microsoft Visual C# 2005 Express Edition
  • Microsoft Visual C# .NET 2003 Standard Edition
  • Microsoft ASP.NET 1.0
  • Microsoft ASP.NET 1.1
??????: 
kbcodesign kbcommandline kbnamespace kbhowtomaster kbmt KB815808 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:815808

??????????? ???

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com