使用Postsharp MethodInterceptionAspect
编译项目时,出现以下错误:
Unhandled exception (postsharp-net40-x86-srv.exe release | .NET Framework 4.7.1): System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at ^nIsIyZ7TTJqY.GetKeyInfo(^8gP93Xsl\+Imn _0)
at ^Up6wxUIUnN6a.^3w8852HL()
at ^Up6wxUIUnN6a.^VfvrABjR()
at ^Up6wxUIUnN6a.^SkiT()
at ^Up6wxUIUnN6a.^8KD6D2SV(String _0)
at ^cyC/TYSlPGB/.^wvPm(^RtksFin57NJ8 _0, ^8gP93Xsl\+Imn _1)
at PostSharp.Sdk.Extensibility.Tasks.CompileTask.Execute()
at PostSharp.Sdk.Extensibility.Project.ExecutePhase(String phase)
at PostSharp.Sdk.Extensibility.Project.Execute()
at PostSharp.Hosting.PostSharpObject.ExecuteProjects()
at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation).
我没有以管理员身份运行Visual Studio(并且不想)。
这种可能的解决方案不起作用: https://stackoverflow.com/a/43182648/201019
当我运行VS广告管理员时,我没有问题。
我已尝试将项目定位框架从4.6.1更改为4.5.1,但无济于事。