我试图将dll安装到GAC,我得到了以下错误:
程序集没有强命名,也没有用最小键长度签名。
下面的代码。我怎么才能避开这一切?
<Product Id="4C76EAE3-148A-4597-A994-0178693C5B25" Name="MySolutionInstaller" Language="1033" Version="1.0.0.0" Manufacturer="Me" UpgradeCode="a5e6cbeb-18be-4f7e-9ab5-f1adb1d947eb">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="MySolutionInstaller" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<!--<Directory Id="INSTALLFOLDER" Name="MyDLLCoreLibrary">-->
<Directory Id="ProductDirectory" Name="MySolutionInstaller">
<Directory Id="GAC" Name="GAC"/>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents">
<Component Id='DataLibraryGAC' Directory="GAC" Guid='a3b57886-4d27-4e4c-a28f-60a061cdd12d'>
<File Id='DataDLLGAC' Name='MyProject.Data.dll' Source='C:\projects\MyProject.Data\bin\Debug\MyProject.Data.dll'
KeyPath="yes" Assembly=".net" />
<!--<RemoveFile Id="RemoveDataDLLGAC" Name="My.Data.dll" On="uninstall" />-->
</Component>
</ComponentGroup>
</Fragment>发布于 2013-05-17 12:06:04
此错误显示程序集没有使用强名称键进行签名。我们需要使用.snk文件对程序集进行签名,以便在GAC中安装它。检查这以对程序集进行签名。
发布于 2013-05-17 15:02:31
另一种避免错误的方法是不把它放在GAC中。相反,将您的程序集放在EXE可以找到的位置。最简单的布局都在一个文件夹中。但是还有其他选项,如运行时如何定位程序集解释的自动探测子文件夹。
不安装到GAC中的一个优点是,您仍然可以设计安装程序,使其无需管理员即可工作。
https://stackoverflow.com/questions/16606171
复制相似问题