我们有一个 Azure Function 应用程序项目,它可以使用 .NET 8 RC2 SDK 在本地构建良好。但是,当通过 Azure Pipeline 进行构建时,在恢复 NuGet 包步骤期间会失败,并引发以下错误:
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.CommandLine.RestoreCommand.<DetermineInputsFromMSBuildAsync>d__63.MoveNext()
##[error]The nuget command failed with exit code(1) and error(D:\a\1\s\some.API.csproj : error : Could not resolve SDK "Microsoft.NET.Sdk".
Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK.
D:\a\1\s\SOME.API.csproj : error : Unable to locate the .NET SDK. Check that it is installed, your PATH is configured …Run Code Online (Sandbox Code Playgroud) 我是 Windows10 的管理员,并尝试按照此处的文档安装 Azure PS 模块。
PS C:\Program Files\PowerShell\7>Install-Module -Name Az -Scope CurrentUser -Force -Allowclobber
但是,我收到如下错误消息。
Run Code Online (Sandbox Code Playgroud)Install-Package: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:9711 Line 9711 talledPackages = PackageManagement\Install-Package @PSBoundParameters安装或更新需要管理员权限。使用具有管理员权限的帐户登录计算机,然后重试,或通过
-Scope CurrentUser在命令中添加“ ”进行安装。您还可以尝试使用提升的权限运行 Windows PowerShell 会话(以管理员身份运行)。
尽管我已经处于管理员权限模式,但它抛出此错误的原因是没有意义的。很少有其他答案要求设置使用 TLS 1.2,我也这样做了。就像这样:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Run Code Online (Sandbox Code Playgroud)
还有什么问题?
我想知道std::forward这里是否有感觉。
template <class T>
void juju(T && x) {
std::forward<T>(x).jaja();
}
Run Code Online (Sandbox Code Playgroud)
我想它没有任何意义,因为它this始终是方法调用中的指针,因此如果它是由右值或左值引用组成的,则没有区别。但请确认我的直觉或解释我为什么错了。
上面的示例是此代码的简化方法,包含jujubeing for_each、TbeingExecutionPolicy和jajabeing get_devices。