我在Visual中打开了一个项目(碰巧是Enyim.Caching)。这个集会想要延期签字。事实上,它非常希望被延迟签名,以至于我无法强迫Visual毫不延迟地对其进行编译。
sn.exe -v所示)。我该怎么做?
发布于 2013-03-18 04:19:41
在本例中,问题是项目“公共属性”引用.
在项目.csproj文件中有以下几行代码:
不幸的是,该文件(CommonProperties.targets)指示VS重写属性,但它没有在用户界面中提供任何明确的指示,说明正在发生这种情况。
解决方案是进入CommonProperties.targets文件并删除以下行:
<!-- delay sign the assembly if the PrivateKeyPath property is not specified -->
<PropertyGroup Condition=" '$(PrivateKeyPath)' == '' And '$(PrivateKeyName)' == ''">
<AssemblyOriginatorKeyFile>..\public_key.snk</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
</PropertyGroup>
<!-- sign the assembly using the specified key file containing both the private and public keys -->
<PropertyGroup Condition=" '$(PrivateKeyPath)' != '' ">
<AssemblyOriginatorKeyFile>$(PrivateKeyPath)</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
</PropertyGroup>
<!-- sign the assembly using the specified key container containing both the private and public keys -->
<PropertyGroup Condition=" '$(PrivateKeyName)' != '' ">
<AssemblyOriginatorKeyFile></AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
</PropertyGroup>将这些行改为:
<PropertyGroup>
<DelaySign>false</DelaySign>
<SignAssembly>false</SignAssembly>
</PropertyGroup>发布于 2013-12-17 08:24:34
遇到了同样的问题。即使在我禁用了“仅延迟标志”和“签名程序集”之后,我仍然得到了错误。
error MSB3325: Cannot import the following key file: . The key file may be password protected"..csproj是正确的:
<PropertyGroup>
<SignAssembly>false</SignAssembly>
<DelaySign>false</DelaySign>
</PropertyGroup>然而,下面还有一条棘手的台词:
<SignAssembly Condition="Exists('..\xxx.pfx')">true</SignAssembly>只有在我删除了.csproj中的行,或者删除了磁盘上的文件之后,才可以使用VS。
好像是VS的窃听器。我正在使用的版本:
Microsoft Visual Studio 2010
Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework
Version 4.5.50709 SP1Relhttps://stackoverflow.com/questions/15469534
复制相似问题