更新到 Visual Studio 版本 16.8.2 后的 Postsharp 构建错误 [英] Postsharp Build Errors after Update to Visual Studio Version 16.8.2

查看:120
本文介绍了更新到 Visual Studio 版本 16.8.2 后的 Postsharp 构建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将 Visual Studio 更新到版本 16.8.2 后,我的使用 Post Sharp 的解决方案不再构建.我没有升级任何项目以使用 .Net 5.以下是我看到的错误:

After updating visual studio to version 16.8.2, my solution which uses Post Sharp no longer builds. I didn't upgrade any projects to use .Net 5. Here are the errors I'm seeing:

严重性代码描述项目文件行抑制状态错误 CS0006 元数据文件 'C:\Dev\repos\hinge\HingeSolution\HingeApi\bin\Debug\netcoreapp3.1\HingeApi.dll' 找不到 HingeApi-tests C:\Dev\repos\hinge\HingeSolution\HingeApi-测试\CSC 1 不适用错误 MSB4064 RuntimeGraphPath"PrepareForReadyToRunCompilation"不支持参数任务.验证该参数是否存在于任务中,并且它是一个可设置的公共实例属性.HingeApi C:\ProgramData\PostSharp\CrossGenPaths\sdk5.0.100-netcoreapp5.0-r5.0.0-win-x64\CrossGen.proj 11
错误 MSB4063 PrepareForReadyToRunCompilation"无法使用其输入参数初始化任务.HingeApi C:\ProgramData\PostSharp\CrossGenPaths\sdk5.0.100-netcoreapp5.0-r5.0.0-win-x64\CrossGen.proj 11
错误进程dotnet"失败,退出代码 1.HingeApi C:\Users\dbdav.nuget\packages\postsharp\6.5.4\build\PostSharp.targets 381错误错误:未处理的异常(PostSharp.Compiler.Hosting.CommandLine.dll 6.5.4 版本 | .NET Core 5.0.0 (X64)):值不能为 null 或空字符串.(参数'value')详情见下文.HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
错误 System.ArgumentException: 值不能为 null 或空字符串.(参数'value') HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
NuGet.Versioning.NuGetVersion.Parse(String value) HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1处的错误(字符串值)
PostSharp.Sdk.Extensibility.PlatformContext.^TTQPa/Ij() 中的错误在 ^f/gziTthOsZk:line 354 HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
PostSharp.Sdk.Extensibility.PlatformContext.^pFnf8wEt() 错误在 ^f/gziTthOsZk:line 114 HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
PostSharp.Sdk.Extensibility.Project.^pFnf8wEt(ProjectConfiguration[] _0, ProjectInvocationParameters _1) 在 ^hW2eIAWj:line 795 HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
中出错PostSharp.Sdk.Extensibility.Project.^pFnf8wEt(ProjectInvocationParameters _0) 中的错误:^hW2eIAWj:line 570 HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
PostSharp.Sdk.Extensibility.Project.LoadProject(ProjectInvocationParameters projectInvocationParameters, Domain& domain) 错误在 ^hW2eIAWj:line 541 HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
C:\src\PostSharp-65\Public\Core\PostSharp.Compiler.Hosting\PostSharpObject.cs:line 256 HingeApi C:\Dev\repos\hinge\HingeSolution 中的 PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation) 出错\HingeApi\POSTSHARP 1
C:\src\PostSharp-65\Public\Core\PostSharp.Compiler.Hosting\Program.cs:line 957 HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi 中的 PostSharp.Hosting.Program.ExecuteImpl() 错误\POSTSHARP 1

Severity Code Description Project File Line Suppression State Error CS0006 Metadata file 'C:\Dev\repos\hinge\HingeSolution\HingeApi\bin\Debug\netcoreapp3.1\HingeApi.dll' could not be found HingeApi-tests C:\Dev\repos\hinge\HingeSolution\HingeApi-tests\CSC 1 N/A Error MSB4064 The "RuntimeGraphPath" parameter is not supported by the "PrepareForReadyToRunCompilation" task. Verify the parameter exists on the task, and it is a settable public instance property. HingeApi C:\ProgramData\PostSharp\CrossGenPaths\sdk5.0.100-netcoreapp5.0-r5.0.0-win-x64\CrossGen.proj 11
Error MSB4063 The "PrepareForReadyToRunCompilation" task could not be initialized with its input parameters. HingeApi C:\ProgramData\PostSharp\CrossGenPaths\sdk5.0.100-netcoreapp5.0-r5.0.0-win-x64\CrossGen.proj 11
Error The process "dotnet" failed with exit code 1. HingeApi C:\Users\dbdav.nuget\packages\postsharp\6.5.4\build\PostSharp.targets 381 Error error: Unhandled exception (PostSharp.Compiler.Hosting.CommandLine.dll 6.5.4 release | .NET Core 5.0.0 (X64)): Value cannot be null or an empty string. (Parameter 'value') See below for details. HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
Error System.ArgumentException: Value cannot be null or an empty string. (Parameter 'value') HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
Error at NuGet.Versioning.NuGetVersion.Parse(String value) HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
Error at PostSharp.Sdk.Extensibility.PlatformContext.^TTQPa/Ij() in ^f/gziTthOsZk:line 354 HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
Error at PostSharp.Sdk.Extensibility.PlatformContext.^pFnf8wEt() in ^f/gziTthOsZk:line 114 HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
Error at PostSharp.Sdk.Extensibility.Project.^pFnf8wEt(ProjectConfiguration[] _0, ProjectInvocationParameters _1) in ^hW2eIAWj:line 795 HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
Error at PostSharp.Sdk.Extensibility.Project.^pFnf8wEt(ProjectInvocationParameters _0) in ^hW2eIAWj:line 570 HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
Error at PostSharp.Sdk.Extensibility.Project.LoadProject(ProjectInvocationParameters projectInvocationParameters, Domain& domain) in ^hW2eIAWj:line 541 HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
Error at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation) in C:\src\PostSharp-65\Public\Core\PostSharp.Compiler.Hosting\PostSharpObject.cs:line 256 HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1
Error at PostSharp.Hosting.Program.ExecuteImpl() in C:\src\PostSharp-65\Public\Core\PostSharp.Compiler.Hosting\Program.cs:line 957 HingeApi C:\Dev\repos\hinge\HingeSolution\HingeApi\POSTSHARP 1

我尝试过重建、清理和构建.有没有人解决过这个问题?

I have tried rebuild, clean and build. Has anyone out there overcome this issue?

推荐答案

由于 MSBuild 更改,PostSharp 6.7 与 .NET 5.0 SDK 不兼容..NET 5.0 SDK 在升级到 VS 16.8 时由 Visual Studio 安装程序安装.

PostSharp 6.7 is not compatible with .NET 5.0 SDK due to MSBuild changes. .NET 5.0 SDK is installed by Visual Studio Installer when upgrading to VS 16.8.

您可以使用 global.json 继续使用 3.1 SDK,也可以使用 PostSharp 6.8.它仍处于预览阶段,但 RC 应该很快就会发布.

You can either stay on 3.1 SDK using global.json or use PostSharp 6.8. It's still in preview, but the RC should be released soon.

更多信息在此处提供.

发布了 Postsharp 6.8 RC.

Postsharp 6.8 RC was released.

这篇关于更新到 Visual Studio 版本 16.8.2 后的 Postsharp 构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆