gpt4 book ai didi

msbuild - Postsharp 抛出 System.Runtime.InteropServices.COMException (0x8013141C) : Strong name key container not found.(HRESULT 异常:0x8013141C)

转载 作者:行者123 更新时间:2023-12-02 16:36:12 26 4
gpt4 key购买 nike

为将来需要解决相同问题的任何人添加问题

环境:Visual Studio 2017 或 2019
Postsharp 对程序集进行签名时出现构建错误

MSBuild postsharptest.csproj /T:Rebuild /P:PostSharpTrace=StrongName /V:D /P:PostSharpHost=Native > postsharp.log

C:\ProgramData\PostSharp\4.0.41\bin.Release\postsharp.4.0-x86.exe obj\Debug\Before-PostSharp\PostsharpTest.exe /X:default /NoLogo /P:Output=C:\PostsharpTest\obj\Debug\PostsharpTest.exe /P:ReferenceDirectory=C:\PostsharpTest /P:Configuration=Debug /P:Platform=AnyCPU "/P:SearchPath=bin\Debug\|obj\Debug\|C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\|C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\ " /P:IntermediateDirectory=obj\Debug\PostSharp /P:CleanIntermediate=False /P:MSBuildProjectFullPath=C:\PostsharpTest\postsharptest.csproj /P:SignAssembly=true /P:PrivateKeyLocation=Thycotic.snk /P:PrivateKeyContainer= /P:DelaySign= "/P:ResolvedReferences=C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll|C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll|C:\PostsharpTest\packages\PostSharp.4.0.41\lib\net35-client\PostSharp.dll|C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll|C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.DataSetExtensions.dll|C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.dll|C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll|C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Net.Http.dll|C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll|C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll" /P:SymbolFile=bin\Debug\PostsharpTest.pssym /P:WriteWeavingSymbols=True /P:ConstraintVerificationEnabled=True /P:RuntimeVerificationEnabled=True /P:TargetFrameworkVersion=v4.5 /P:TargetFrameworkIdentifier=.NETFramework /P:TargetFrameworkProfile= "/P:TargetFrameworkMoniker=.NETFramework,v4.5" "/P:NativeFrameworkMoniker=.NETFramework,v4.5.1" /P:BindingMapsDirectory=C:\ProgramData\PostSharp\4.0.41\BindingMaps /P:PostSharpLibraryProfile= /P:AspectProviders= "/P:Language=C#" /T:StrongName /config C:\ProgramData\PostSharp\4.0.41\bin.Release\postsharp.4.0-x86.exe.config
C:\PostsharpTest\postsharptest.csproj : warning PS0131: The project 'ModuleDeclaration PostsharpTest.exe' does not contain any aspect or other transformation. You can disable PostSharp for this project by editing the project properties in Visual Studio. Remember to enable PostSharp back if you add an aspect to this project.
C:\PostsharpTest\postsharptest.csproj : error PS0099: Unhandled exception (4.0.41.0, 32 bit, CLR 4.5, Release): System.Runtime.InteropServices.COMException (0x8013141C): Strong name key container not found. (Exception from HRESULT: 0x8013141C)
C:\PostsharpTest\postsharptest.csproj : error PS0099: at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
C:\PostsharpTest\postsharptest.csproj : error PS0099: at ^nIsIyZ7TTJqY.GetKeyInfo(^8gP93Xsl\+Imn _0)
C:\PostsharpTest\postsharptest.csproj : error PS0099: at ^Up6wxUIUnN6a.^3w8852HL()
C:\PostsharpTest\postsharptest.csproj : error PS0099: at ^Up6wxUIUnN6a.^VfvrABjR()
C:\PostsharpTest\postsharptest.csproj : error PS0099: at ^Up6wxUIUnN6a.^SkiT()
C:\PostsharpTest\postsharptest.csproj : error PS0099: at ^Up6wxUIUnN6a.^8KD6D2SV(String _0)
C:\PostsharpTest\postsharptest.csproj : error PS0099: at ^cyC/TYSlPGB/.^wvPm(^RtksFin57NJ8 _0, ^8gP93Xsl\+Imn _1)
C:\PostsharpTest\postsharptest.csproj : error PS0099: at PostSharp.Sdk.Extensibility.Tasks.CompileTask.Execute()
C:\PostsharpTest\postsharptest.csproj : error PS0099: at PostSharp.Sdk.Extensibility.Project.ExecutePhase(String phase)
C:\PostsharpTest\postsharptest.csproj : error PS0099: at PostSharp.Sdk.Extensibility.Project.Execute()
C:\PostsharpTest\postsharptest.csproj : error PS0099: at PostSharp.Hosting.PostSharpObject.ExecuteProjects()
C:\PostsharpTest\postsharptest.csproj : error PS0099: at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation).

Properties | Signing | Sign the assembly

最佳答案

我在尝试使用 Microsoft's Strong Name Tool 创建新的签名 key 时能够解决问题(SN.exe),我收到拒绝访问错误。

sn -k jeff.snk
Failed to generate a strong name key pair -- Access is denied.

使用 Process Monitor向我展示了问题是拒绝访问 C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys 中的特定文件。在授予我对目录中所有文件的权限后,我能够创建签名 key 并运行 msbuild 而没有任何错误。

关于msbuild - Postsharp 抛出 System.Runtime.InteropServices.COMException (0x8013141C) : Strong name key container not found.(HRESULT 异常:0x8013141C),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62678594/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com