1 - 搭建 windows 开发环境

搭建用于 Durable Task Framework的 windows 开发环境

1.1 - 安装git

在 windows 上安装 git

安装 git

下载 git 的 windows 安装包,一路 next 安装即可。

为了避免空格,我将安装路径从默认的 C:\Program Files\Git 修改为 C:\soft\git

安装完成之后,除了 git 外,还顺便得到了一个 bash 终端,它至少比 windows 自带的终端要好用。

后面会继续安装 zsh 来替代 bash。

配置自动登录

将本地的 id_rsa.pub 公钥传到 windows 机器

scp id_rsa.pub sky@192.168.0.103:~/.ssh/

然后加入到 authorized_keys ,注意由于登录的账号是 administrator 账号,所以 authorized_keys 的文件路径是 “C:\ProgramData\ssh\administrators_authorized_keys” 而不是 “~/.ssh\administrators_authorized_keys”

用管理员身份运行 bash,然后执行命令:

 touch "C:\ProgramData\ssh\administrators_authorized_keys"
 
 cat ~/.ssh/id_rsa.pub >> "C:\ProgramData\ssh\administrators_authorized_keys"

用管理员身份运行 powershell,修改文件属性:

icacls.exe "C:\ProgramData\ssh\administrators_authorized_keys" /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"

之后就可以在 openssh client 直接 ssh ,不用输入密码。

ssh sky@192.168.0.103

参考:

1.2 - 安装 OpenSSH server

在 windows 上安装 OpenSSH server

参考:

使用 powershell 安装

注意:必须以管理员身份运行 powershell。

检查是否安装

检查有没有安装 OpenSSH :

Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'

如果没有安装则输出为:

Name  : OpenSSH.Client~~~~0.0.1.0
State : NotPresent

Name  : OpenSSH.Server~~~~0.0.1.0
State : NotPresent

如果已经安装则输出为:

Name  : OpenSSH.Client~~~~0.0.1.0
State : Installed

Name  : OpenSSH.Server~~~~0.0.1.0
State : Installed

安装 OpenSSH Client 和 Server

执行安装命令:

# Install the OpenSSH Client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

# Install the OpenSSH Server
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

启动 OpenSSH Server

启动 OpenSSH Server 并验证防火墙设置:

# Start the sshd service
Start-Service sshd

# Confirm the Firewall rule is configured. It should be created automatically by setup. Run the following to verify
if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) {
    Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..."
    New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
} else {
    Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists."
}

设置开机自动启动

# OPTIONAL but recommended:
Set-Service -Name sshd -StartupType 'Automatic'

配置 openssh server

配置默认 shell

请在安装好 git (自带bash) 之后再进行这个配置,假定 bash 的安装路径是:C:\soft\git\usr\bin\bash.exe

用 powershell 执行命令:

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\soft\git\usr\bin\bash.exe" -PropertyType String -Force

如果想把默认shell修改为 zsh,最好是先安装上面的方法将默认 shell 设置为 git 带的 bash,然后再让bash启动zsh,这样就能够利用到 git 带的 bash 里面的一些基本的 linux 命令。如果直接将默认shell改为 zsh,则 ssh 登录之后会报错如下:

/c/Users/sky/.oh-my-zsh/oh-my-zsh.sh:65: command not found: mkdir
/c/Users/sky/.oh-my-zsh/oh-my-zsh.sh:124: command not found: rm

警告:

这个修改完成后,在终端 ssh 上去可以正常工作。但是用 vs code remote ssh 连接上去,就会报错:

[19:30:31.224] stderr> /usr/bin/bash: line 3: $'\202': command not found
[19:30:31.230] stderr> /usr/bin/bash: line 4: name: command not found
[19:30:31.236] stderr> /usr/bin/bash: line 6: $'\202': command not found
[19:30:31.242] stderr> /usr/bin/bash: line 8: $'\202': command not found
[19:30:31.248] stderr> /usr/bin/bash: line 10: $'\202': command not found
[19:30:31.253] stderr> /usr/bin/bash: line 12: $'\202': command not found
......
[19:31:05.042] stderr> /usr/bin/bash: line 5432: $'\202': command not found
[19:31:05.048] stderr> /usr/bin/bash: line 5434: $'\202': command not found
[19:31:05.054] stderr> /usr/bin/bash: line 5436: $'\202': command not found
[19:31:05.057] Terminating local server
[19:31:05.060] Exec server for ssh-remote+192.168.0.103 failed: Error: Connecting with SSH timed out

暂时先回滚这个配置:

Remove-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Force

1.3 - 安装zsh和ohmyzsh

在 windows 上安装 zsh和ohmyzsh

参考:

安装 zsh

假定前面已经安装好了 git 并自带 bash。

下载zsh

Zsh下载地址:

https://packages.msys2.org/package/zsh?repo=msys&variant=x86_64

下载 .tar.zst 文件:

https://mirror.msys2.org/msys/x86_64/zsh-5.9-2-x86_64.pkg.tar.zst

这个文件可以用 winrar 解压缩,得到 zsh-5.9-2-x86_64.pkg 目录,里面有两个子目录:etc 和 usr 。

安装zsh

复制 etc 和 usr 目录,粘贴到 git 的安装目录如 C:\Program Files\Git\,git 安装目录下同样有 etc 和 usr 目录,文件会自动合并进去。

运行zsh

运行时,要先启动 git 自带的 bash 终端,然后执行 zsh 命令,也可以查看 zsh 版本:

zsh --version

为了方便使用,尤其是用 zsh 替代 bash,可以修改 bash 的配置文件 ~/.bashrc (如果没有就创建它) ,加入内容:

/c/Windows/System32/chcp.com 65001 > /dev/null 2>&1

if [ -t 1 ]; then
  exec zsh
fi

这样就可以自动 bash 时自动启动 zsh。

第一次执行时会询问文件创建的问题,选择

Quit and do nothing.  The function will be run again next time.

安装 Oh my zsh!

安装

在 zsh 终端执行:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

准备字体

在这里下载并安装几个字体

https://github.com/romkatv/powerlevel10k#meslo-nerd-font-patched-for-powerlevel10k

安装 Powerlevel10k 主题

下载:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

修改

vi ~/.zshrc

增加内容:

ZSH_THEME="powerlevel10k/powerlevel10k"
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(history)
POWERLEVEL9K_SHORTEN_DIR_LENGTH=1

# User configuration

export LS_COLORS="rs=0:no=00:mi=00:mh=00:ln=01;36:or=01;31:di=01;34:ow=04;01;34:st=34:tw=04;34:pi=01;33:so=01;33:do=01;33:bd=01;33:cd=01;33:su=01;35:sg=01;35:ca=01;35:ex=01;32:"

配置插件

下载以下插件:

git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/Pilaton/OhMyZsh-full-autoupdate.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/ohmyzsh-full-autoupdate

修改 zsh 配置

vi ~/.zshrc

修改 plugins 为

plugins=(
    adb
    command-not-found
    extract
    deno
    docker
    git
    github
    gitignore
    history-substring-search
    node
    npm
    nvm
    yarn
    volta
    vscode
    sudo
    web-search
    z
    zsh-autosuggestions
    zsh-syntax-highlighting
    ohmyzsh-full-autoupdate
)

# User configuration

ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor root line)
ZSH_HIGHLIGHT_PATTERNS=('rm -rf *' 'fg=white,bold,bg=red')

重启 zsh。

Updating plugins and themes Oh My ZSH
--------------------------------------

Updating Plugin — ohmyzsh-full-autoupdate -> https://github.com/Pilaton/OhMyZsh-full-autoupdate
Already up to date.

Updating Plugin — zsh-autosuggestions -> https://github.com/zsh-users/zsh-autosuggestions
Already up to date.

Updating Plugin — zsh-syntax-highlighting -> https://github.com/zsh-users/zsh-syntax-highlighting
Already up to date.

Updating Theme — powerlevel10k -> https://github.com/romkatv/powerlevel10k
Already up to date.

1.4 - 配置 VS Code 的 remote ssh

在 windows 上配置 VS Code 的 remote ssh

前面的准备工作中,已经在 windows 上安装了 openssh-server,因此现在可以利用 vs code 的 remote ssh 功能来实现在 windows 上开发代码,但是 vs code 界面可以运行在其他地方,如我的 m1 笔记本。

连接 windows 主机

在 vs code 中,通过 “connect to host” 连接到前面准备好的 windows。

第一次会自动下载并准备 vs code 后端。

打开项目

打开项目时,报错:

C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.SqlServer.Tests\DurableTask.SqlServer.Tests.csproj : error NU1903: Warning As Error: Package 'System.Data.SqlClient' 4.8.5 has a known high severity vulnerability, https://github.com/advisories/GHSA-98g6-xh36-x2p7 [C:\Users\sky\work\code\durabletask\durabletask\DurableTask.sln]
  Failed to restore C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.SqlServer.Tests\DurableTask.SqlServer.Tests.csproj (in 1.2 sec).
  23 of 24 projects are up-to-date for restore.

1.5 - 安装.NET SDK

在 windows 上安装.NET SDK

.NET 6.0 SDK

https://dotnet.microsoft.com/en-us/download/dotnet/6.0

下载到 dotnet-sdk-6.0.420-win-x64.exe ,执行安装

下载安装 .NET 6.0 SDK

下列项安装于: ""
    • .NET SDK 6.0.420
    • .NET Runtime 6.0.28
    • ASP.NET Core Runtime 6.0.28
    • .NET Windows Desktop Runtime 6.0.28

.NET 8.0 SDK

https://dotnet.microsoft.com/zh-cn/download/dotnet/sdk-for-vs-code?utm_source=vs-code&utm_medium=referral&utm_campaign=sdk-install'

.NET 8.0 SDK

下载到 dotnet-sdk-8.0.203-win-x64.exe ,执行安装,但是不知道安装到哪里去了。。。

下列产品已安装: 
    • .NET SDK 8.0.203
    • .NET Runtime 8.0.3
    • ASP.NET Core Runtime 8.0.3
    • .NET Windows Desktop Runtime 8.0.3

查看一下:

$ dotnet --version
8.0.203

$ which dotnet
/c/Program Files/dotnet/dotnet

$ echo $PATH
/c/Users/sky/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/sky/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/cmd:/c/Program Files/dotnet:/c/Users/sky/AppData/Local/Microsoft/WindowsApps:/bin:/c/Users/sky/.dotnet/tools:/usr/bin/vendor_perl:/usr/bin/core_perl

PATH 中增加了两个路径:

  • /c/Program Files/dotnet
  • /c/Users/sky/.dotnet/tools

.NET Core 3.1 Runtime

还必须安装这个 3.1 runtime,虽然已经被标注为 此版本已过期:

Testhost process for source(s) 'C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Core.Tests\bin\Debug\netcoreapp3.1\DurableTask.Core.Tests.dll' exited with error: You must install or update .NET to run this application.
App: C:\Users\sky\.nuget\packages\microsoft.testplatform.testhost\15.9.0\lib\netstandard1.5\testhost.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '3.1.0' (x64)
.NET location: C:\Program Files\dotnet\
The following frameworks were found:
  6.0.28 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  8.0.3 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Learn more:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=3.1.0&arch=x64&rid=win-x64&os=win10
. Please check the diagnostic logs for more information.

下载地址:

https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=3.1.0&arch=x64&rid=win-x64&os=win10

下载得到 dotnet-runtime-3.1.32-win-x64.exe 文件,安装即可。

.NET Core 2.1 Runtime

还必须安装这个 2.1 runtime,azure-functions-durable-extension 项目需要:

https://dotnet.microsoft.com/zh-cn/download/dotnet/2.1/runtime

下载得到 dotnet-runtime-2.1.30-win-x64.exe 文件,安装即可。

1.6 - 安装nuget

在 windows 上安装nuget

下载

下载地址:

https://www.nuget.org/downloads

安装

nuget.exe 复制到 C:\soft\nuget 目录,然后修改 windows 系统设置中的 path 环境变量,加入地址 C:\soft\nuget

验证

查看版本:

$ nuget
NuGet 版本: 6.9.1.3

1.7 - 本地发布

在本地发布包并在其他项目使用

发布到本地

实际操作

durabletask-dotnet 项目

修改 eng\targets\Release.props ,从版本号从 1.2.2:

<VersionPrefix>1.2.2</VersionPrefix>
<VersionSuffix></VersionSuffix>

修改为 1.2.3-alpha

    <VersionPrefix>1.2.3</VersionPrefix>
    <VersionSuffix>alpha</VersionSuffix>

修改代码,构建项目:

# git submodule update --init --recursive
# git submodule update --remote: see https://stackoverflow.org.cn/questions/1777854
# cd ~/work/code/durabletask-fork/durabletask-dotnet
rm -rf out/bin
rm -rf out/pkg
dotnet build
dotnet pack

看到输出:

PS C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet> dotnet pack
用于 .NET MSBuild 版本 17.9.6+a4ecab324
  正在确定要还原的项目…
  所有项目均是最新的,无法还原。
  Generators -> C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out\bin\Release\Generators\netstandard2.0\Microsoft.DurableTask.Generators.dll
  Abstractions -> C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out\bin\Release\Abstractions\netstandard2.0\Microsoft.DurableTask.Abstractions.dll
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Generators.1.0.0-preview.1.nupkg”。
  Grpc -> C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out\bin\Release\Grpc\netstandard2.0\Microsoft.DurableTask.Grpc.dll
  Grpc -> C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out\bin\Release\Grpc\net6.0\Microsoft.DurableTask.Grpc.dll
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Abstractions.1.2.3-alpha.nupkg”。
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Abstractions.1.2.3-alpha.snupkg”。
  Client -> C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out\bin\Release\Client\netstandard2.0\Microsoft.DurableTask.Client.dll
  Worker -> C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out\bin\Release\Worker\netstandard2.0\Microsoft.DurableTask.Worker.dll
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Grpc.1.2.3-alpha.nupkg”。
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Grpc.1.2.3-alpha.snupkg”。
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Client.1.2.3-alpha.nupkg”。
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Client.1.2.3-alpha.snupkg”。
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Worker.1.2.3-alpha.nupkg”。
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Worker.1.2.3-alpha.snupkg”。
  Worker.Grpc -> C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out\bin\Release\Worker.Grpc\net6.0\Microsoft.DurableTask.Worker.Grpc.dll
  Worker.Grpc -> C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out\bin\Release\Worker.Grpc\netstandard2.0\Microsoft.DurableTask.Worker.Grpc.dll
  Client.OrchestrationServiceClientShim -> C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out\bin\Release\Client.OrchestrationServiceClientShim\netstandard
  2.0\Microsoft.DurableTask.Client.OrchestrationServiceClientShim.dll
  Client.Grpc -> C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out\bin\Release\Client.Grpc\netstandard2.0\Microsoft.DurableTask.Client.Grpc.dll
C:\Program Files\dotnet\sdk\8.0.203\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5104: 包的稳定版本不应有预发布依赖项。请修改依赖
项“Microsoft.DurableTa
sk.Client [1.2.3-alpha, )”的版本规范,或更新 nuspec 中的版本字段。 [C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\src\Client\OrchestrationServiceClientShim\Client.Orchest
rationServiceClientShim.csproj]
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Client.OrchestrationServiceClientShim.1.0.5.nupkg”。
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Client.OrchestrationServiceClientShim.1.0.5.snupkg”。
  Client.Grpc -> C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out\bin\Release\Client.Grpc\net6.0\Microsoft.DurableTask.Client.Grpc.dll
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Worker.Grpc.1.2.3-alpha.nupkg”。
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Worker.Grpc.1.2.3-alpha.snupkg”。
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Client.Grpc.1.2.3-alpha.nupkg”。
  已成功创建包“C:\Users\sky\work\code\durabletask-fork\durabletask-dotnet\out/pkg/Microsoft.DurableTask.Client.Grpc.1.2.3-alpha.snupkg”。

nupkg 和 package 之间的对应关系:

nupkg file package
Microsoft.DurableTask.Abstractions.1.2.3.nupkg
Microsoft.DurableTask.Client.1.2.3.nupkg
Microsoft.DurableTask.Client.Grpc.1.2.3.nupkg microsoft.durabletask.client.grpc
Microsoft.DurableTask.Client.OrchestrationServiceClientShim.1.0.5.nupkg
Microsoft.DurableTask.Generators.1.0.0-preview.1.nupkg
Microsoft.DurableTask.Grpc.1.2.3.nupkg microsoft.durabletask.grpc
Microsoft.DurableTask.Worker.Grpc.1.2.3.nupkg microsoft.durabletask.worker.grpc
Microsoft.DurableTask.Worker.1.2.3.nupkg microsoft.durabletask.worker

发布文件到 nuget 本地仓库:

rm -rf "C:\soft\nuget-local-package\microsoft.durabletask.abstractions"
rm -rf "C:\soft\nuget-local-package\microsoft.durabletask.client"
rm -rf "C:\soft\nuget-local-package\microsoft.durabletask.client.grpc"
rm -rf "C:\soft\nuget-local-package\microsoft.durabletask.grpc"
rm -rf "C:\soft\nuget-local-package\microsoft.durabletask.worker"
rm -rf "C:\soft\nuget-local-package\microsoft.durabletask.worker.grpc"

rm -rf "C:\Users\sky\.nuget\packages\microsoft.durabletask.abstractions"
rm -rf "C:\Users\sky\.nuget\packages\microsoft.durabletask.client"
rm -rf "C:\Users\sky\.nuget\packages\microsoft.durabletask.client.grpc"
# rm -rf "C:\Users\sky\.nuget\packages\microsoft.durabletask.generators"
rm -rf "C:\Users\sky\.nuget\packages\microsoft.durabletask.grpc"
# rm -rf "C:\Users\sky\.nuget\packages\microsoft.durabletask.sidecar"
# rm -rf "C:\Users\sky\.nuget\packages\microsoft.durabletask.sidecar.protobuf"
rm -rf "C:\Users\sky\.nuget\packages\microsoft.durabletask.worker"
rm -rf "C:\Users\sky\.nuget\packages\microsoft.durabletask.worker.grpc"

nuget add out/pkg/Microsoft.DurableTask.Abstractions.1.2.3-alpha.nupkg -source "C:\soft\nuget-local-package"
nuget add out/pkg/Microsoft.DurableTask.Client.1.2.3-alpha.nupkg -source "C:\soft\nuget-local-package"
nuget add out/pkg/Microsoft.DurableTask.Worker.1.2.3-alpha.nupkg -source "C:\soft\nuget-local-package"
nuget add out/pkg/Microsoft.DurableTask.Grpc.1.2.3-alpha.nupkg -source "C:\soft\nuget-local-package"
nuget add out/pkg/Microsoft.DurableTask.Client.Grpc.1.2.3-alpha.nupkg -source "C:\soft\nuget-local-package"
nuget add out/pkg/Microsoft.DurableTask.Worker.Grpc.1.2.3-alpha.nupkg -source "C:\soft\nuget-local-package"

azure-functions-durable-extension 项目

修改 src\Worker.Extensions.DurableTask\Worker.Extensions.DurableTask.csproj 文件,

  <ItemGroup>
    ......
    <PackageReference Include="Microsoft.DurableTask.Client.Grpc" Version="1.2.2" />
    <PackageReference Include="Microsoft.DurableTask.Worker.Grpc" Version="1.2.2" />
  </ItemGroup>

修改为

  <ItemGroup>
    ......
    <PackageReference Include="Microsoft.DurableTask.Client.Grpc" Version="1.2.3-alpha" />
    <PackageReference Include="Microsoft.DurableTask.Worker.Grpc" Version="1.2.3-alpha" />
  </ItemGroup>

修改 nuget.config 文件

<configuration>
  <packageSources>
    ......
    <add key="nugetlocal" value="C:\soft\nuget-local-package" />
  </packageSources>
</configuration>

这个项目也需要打包给其他项目用,因此类似的也需要修改版本,打开 src\Worker.Extensions.DurableTask\Worker.Extensions.DurableTask.csproj 文件

    <!-- Version information -->
    <VersionPrefix>1.1.2</VersionPrefix>
    <VersionSuffix></VersionSuffix>

修改为

    <!-- Version information -->
    <VersionPrefix>1.1.3</VersionPrefix>
    <VersionSuffix>alpha</VersionSuffix>

之后就可以执行

dotnet build

命令来打包

rm -rf "C:\soft\nuget-local-package\microsoft.azure.functions.worker.extensions.durabletask"
rm -rf "C:\Users\sky\.nuget\packages\microsoft.azure.functions.worker.extensions.durabletas"

nuget add "src\Worker.Extensions.DurableTask\bin\Debug\Microsoft.Azure.Functions.Worker.Extensions.DurableTask.1.1.3-alpha.nupkg" -source "C:\soft\nuget-local-package"

quickstart 项目

在项目根目录下增加 nuget.config 文件,内容为:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear/>
    <add key="nugetlocal" value="C:\soft\nuget-local-package" />
  </packageSources>
</configuration>

修改项目的 csproj 文件,如 MyDurableFunction1.csproj

    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.1.2" />

修改为

    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.1.3-alpha" />

构建之前,最好先删除掉 “C:\Users\sky.nuget\packages" 下要用的依赖(命令在上面),避免缓存造成版本没有更新。

1.8 - nuget 401

nuget 401

报错

构建时突然遇到 401 (Unauthorized) 错误,然后就无法继续构建:

dotnet build
适用于 .NET MSBuild 版本 17.9.6+a4ecab324
  正在确定要还原的项目…
C:\Users\sky\work\code\durabletask\durabletask-dotnet\test\Generators.Tests\Generators.Tests.csproj : error NU1301: 无法加载源 https://pkgs.dev.azure.com/azfunc/e6a70c92-412
8-43
9f-8012-382fe78d6396/_packaging/AzureFunctionsTempStaging/nuget/v3/index.json 的服务索引。 [C:\Users\sky\work\code\durabletask\durabletask-dotnet\Microsoft.DurableTask.sln]
  未能还原 C:\Users\sky\work\code\durabletask\durabletask-dotnet\test\Generators.Tests\Generators.Tests.csproj (用时 15.28 sec)C:\Program Files\dotnet\sdk\8.0.203\NuGet.targets(169,5): error : 无法加载源 https://pkgs.dev.azure.com/azfunc/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/AzureFunctions
Temp
Staging/nuget/v3/index.json 的服务索引。 [C:\Users\sky\work\code\durabletask\durabletask-dotnet\Microsoft.DurableTask.sln]
C:\Program Files\dotnet\sdk\8.0.203\NuGet.targets(169,5): error :   Response status code does not indicate success: 401 (Unauthorized). [C:\Users\sky\work\code\durabletask\ 
durabletask-dotnet\Microsoft.DurableTask.sln]

访问地址 https://pkgs.dev.azure.com/azfunc/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/AzureFunctions Temp Staging/nuget/v3/index.json 时报错 401:

Response status code does not indicate success: 401 (Unauthorized)
dotnet build --interactive
适用于 .NET MSBuild 版本 17.9.6+a4ecab324
  正在确定要还原的项目…
      [CredentialProvider]DeviceFlow: https://pkgs.dev.azure.com/azfunc/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/AzureFunctionsTempStaging/nuget/v3/index.json
      [CredentialProvider]ATTENTION: User interaction required.

      **********************************************************************

      To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code IDJNNR9QS to authenticate.

      **********************************************************************

      [CredentialProvider]DeviceFlow: https://pkgs.dev.azure.com/azfunc/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/AzureFunctionsTempStaging/nuget/v3/index.json
      [CredentialProvider]ATTENTION: User interaction required.

      **********************************************************************

      To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code IZGMCADU2 to authenticate.

      **********************************************************************

2 - durabletask项目

搭建durabletask项目的开发环境

2.1 - 构建项目

构建 Durable Task 项目

获取源码

cd ~/work/code/durabletask
git clone git@github.com:Azure/durabletask.git

执行 build

遇到问题

在终端执行命令:

$ cd ~/work/code/durabletask/durabletask
dotnet build

报错如下:

dotnet build
MSBuild version 17.9.6+a4ecab324 for .NET
  Determining projects to restore...
C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' is 
out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\
sky\work\code\durabletask\durabletask\samples\Correlation.Samples\Correlation.Samples.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' is 
out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\
sky\work\code\durabletask\durabletask\test\DurableTask.Stress.Tests\DurableTask.Stress.Tests.csproj::TargetFramework=netcoreapp3.1]
C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.SqlServer.Tests\DurableTask.SqlServer.Tests.csproj : error NU1903: Warning As Error: Package 'System.Data.SqlCli
ent' 4.8.5 has a known high severity vulnerability, https://github.com/advisories/GHSA-98g6-xh36-x2p7 [C:\Users\sky\work\code\durabletask\durabletask\DurableTask.sln]
  Failed to restore C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.SqlServer.Tests\DurableTask.SqlServer.Tests.csproj (in 374 ms).
  23 of 24 projects are up-to-date for restore.

Build FAILED.

C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' is 
out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\
sky\work\code\durabletask\durabletask\samples\Correlation.Samples\Correlation.Samples.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' is 
out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\
sky\work\code\durabletask\durabletask\test\DurableTask.Stress.Tests\DurableTask.Stress.Tests.csproj::TargetFramework=netcoreapp3.1]
C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.SqlServer.Tests\DurableTask.SqlServer.Tests.csproj : error NU1903: Warning As Error: Package 'System.Data.SqlCli
ent' 4.8.5 has a known high severity vulnerability, https://github.com/advisories/GHSA-98g6-xh36-x2p7 [C:\Users\sky\work\code\durabletask\durabletask\DurableTask.sln]
    2 Warning(s)
    1 Error(s)

vs code 也会因为这个错误而无法解析项目。

解决方案

TBD

临时解决方案

修改 DurableTask.sln 文件,删除 DurableTask.SqlServer.Tests.csproj 这个项目:

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DurableTask.SqlServer.Tests", "test\DurableTask.SqlServer.Tests\DurableTask.SqlServer.Tests.csproj", "{B835BFA6-D9BB-47C4-8594-38EAE0157BBA}"
EndProject

再删除 313 行:

		{B835BFA6-D9BB-47C4-8594-38EAE0157BBA} = {95C69A06-7F62-4652-A480-207B614C2869}

build 结果

dotnet build
MSBuild version 17.9.6+a4ecab324 for .NET
  Determining projects to restore...
C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' is 
out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\
sky\work\code\durabletask\durabletask\samples\Correlation.Samples\Correlation.Samples.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' is 
out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\
sky\work\code\durabletask\durabletask\test\DurableTask.Stress.Tests\DurableTask.Stress.Tests.csproj::TargetFramework=netcoreapp3.1]
  All projects are up-to-date for restore.
C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' is 
out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\
sky\work\code\durabletask\durabletask\test\DurableTask.Stress.Tests\DurableTask.Stress.Tests.csproj::TargetFramework=netcoreapp3.1]
C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' is 
out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\
sky\work\code\durabletask\durabletask\samples\Correlation.Samples\Correlation.Samples.csproj]
  DurableTask.Core -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Core\bin\Debug\net462\DurableTask.Core.dll
  DurableTask.Core -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Core\bin\Debug\netstandard2.0\DurableTask.Core.dll
  DurableTask.SqlServer -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.SqlServer\bin\Debug\net462\DurableTask.SqlServer.dll
  DurableTask.Emulator -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Emulator\bin\Debug\net462\DurableTask.Emulator.dll
  DurableTask.Test.Orchestrations -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.Test.Orchestrations\bin\Debug\net462\DurableTask.Test.Orchestrations.dll
  The package Microsoft.Azure.DurableTask.Core.2.16.2 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why package readmes are important
  .
  Successfully created package 'C:\Users\sky\work\code\durabletask\durabletask\build_output\packages\Microsoft.Azure.DurableTask.Core.2.16.2.nupkg'.
  Successfully created package 'C:\Users\sky\work\code\durabletask\durabletask\build_output\packages\Microsoft.Azure.DurableTask.Core.2.16.2.symbols.nupkg'.
  DurableTask.ServiceBus -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.ServiceBus\bin\Debug\net462\DurableTask.ServiceBus.dll
  DurableTask.ApplicationInsights -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.ApplicationInsights\bin\Debug\netstandard2.0\DurableTask.ApplicationInsights
  .dll
  DurableTask.Test.Orchestrations -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.Test.Orchestrations\bin\Debug\netstandard2.0\DurableTask.Test.Orchestration
  s.dll
  DurableTask.Redis -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Redis\bin\Debug\netstandard2.0\DurableTask.Redis.dll
  DurableTask.SqlServer -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.SqlServer\bin\Debug\netstandard2.0\DurableTask.SqlServer.dll
  DurableTask.AzureServiceFabric -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.AzureServiceFabric\bin\x64\Debug\net462\DurableTask.AzureServiceFabric.dll
  DurableTask.AzureServiceFabric -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.AzureServiceFabric\bin\x64\Debug\net472\DurableTask.AzureServiceFabric.dll
  DurableTask.Emulator -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Emulator\bin\Debug\netstandard2.0\DurableTask.Emulator.dll
  DurableTask.Core.Tests -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.Core.Tests\bin\Debug\net462\DurableTask.Core.Tests.dll
  DurableTask.AzureStorage -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.AzureStorage\bin\Debug\netstandard2.0\DurableTask.AzureStorage.dll
  TestApplication.Common -> C:\Users\sky\work\code\durabletask\durabletask\test\TestFabricApplication\TestApplication.Common\bin\x64\Debug\net472\TestApplication.Common.dll
  DurableTask.Emulator.Tests -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.Emulator.Tests\bin\Debug\net462\DurableTask.Emulator.Tests.dll
  DurableTask.ServiceBus -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.ServiceBus\bin\Debug\netstandard2.0\DurableTask.ServiceBus.dll
  DurableTask.AzureStorage -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.AzureStorage\bin\Debug\net462\DurableTask.AzureStorage.dll
  DurableTask.AzureServiceFabric.Tests -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Tests\bin\x64\Debug\net462\DurableTask.AzureService
  Fabric.Tests.dll
  TestApplication.Common -> C:\Users\sky\work\code\durabletask\durabletask\test\TestFabricApplication\TestApplication.Common\bin\x64\Debug\net462\TestApplication.Common.dll
  The package Microsoft.Azure.DurableTask.Redis.0.1.9-alpha is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why package readmes are imp
  ortant.
  Successfully created package 'C:\Users\sky\work\code\durabletask\durabletask\build_output\packages\Microsoft.Azure.DurableTask.Redis.0.1.9-alpha.nupkg'.
  DurableTask.ServiceBus.Tests -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.ServiceBus.Tests\bin\Debug\net462\DurableTask.ServiceBus.Tests.dll
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277: Found conflicts between different versions of "Newtonsoft.Json" that could
 not be resolved. [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj] 
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277: There was a conflict between "Newtonsoft.Json, Version=7.0.0.0, Culture=ne 
utral, PublicKeyToken=30ad4fe6b2a6aeed" and "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed". [C:\Users\sky\work\code\durabletask\durableta 
sk\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:     "Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30a 
d4fe6b2a6aeed" was chosen because it was primary and "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" was not. [C:\Users\sky\work\code\dura 
bletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:     References which depend on "Newtonsoft.Json, Version=7.0.0.0, Culture= 
neutral, PublicKeyToken=30ad4fe6b2a6aeed" [C:\Users\sky\.nuget\packages\newtonsoft.json\7.0.1\lib\net45\Newtonsoft.Json.dll]. [C:\Users\sky\work\code\durabletask\durabletask\te 
st\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:         C:\Users\sky\.nuget\packages\newtonsoft.json\7.0.1\lib\net45\Newto 
nsoft.Json.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]    
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\sky\ 
.nuget\packages\newtonsoft.json\7.0.1\lib\net45\Newtonsoft.Json.dll". [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\Dura 
bleTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\.nuget\packages\newtonsoft.json\7.0.1\lib\net45\N 
ewtonsoft.Json.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj 
]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:     References which depend on or have been unified to "Newtonsoft.Json, V 
ersion=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" []. [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\Dur 
ableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:         C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Cor 
e\bin\Debug\net462\DurableTask.Core.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Int 
egration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\sky\ 
work\code\durabletask\durabletask\src\DurableTask.Core\bin\Debug\net462\DurableTask.Core.dll". [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabr 
ic.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask 
.Core\bin\Debug\net462\DurableTask.Core.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric 
.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\test\DurableTas 
k.Test.Orchestrations\bin\Debug\net462\DurableTask.Test.Orchestrations.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests 
\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask 
.AzureServiceFabric\bin\x64\Debug\net462\DurableTask.AzureServiceFabric.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Test 
s\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\test\TestFabric 
Application\TestApplication.Common\bin\x64\Debug\net462\TestApplication.Common.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integrati 
on.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:         C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Azu 
reServiceFabric\bin\x64\Debug\net462\DurableTask.AzureServiceFabric.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\Du 
rableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\sky\ 
work\code\durabletask\durabletask\src\DurableTask.AzureServiceFabric\bin\x64\Debug\net462\DurableTask.AzureServiceFabric.dll". [C:\Users\sky\work\code\durabletask\durabletask\t 
est\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask 
.AzureServiceFabric\bin\x64\Debug\net462\DurableTask.AzureServiceFabric.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Test 
s\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:         C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.client\5.2.6\ 
lib\net45\System.Net.Http.Formatting.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.In 
tegration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\sky\ 
.nuget\packages\microsoft.aspnet.webapi.client\5.2.6\lib\net45\System.Net.Http.Formatting.dll". [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFab 
ric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.client\5. 
2.6\lib\net45\System.Net.Http.Formatting.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabri 
c.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask 
.AzureServiceFabric\bin\x64\Debug\net462\DurableTask.AzureServiceFabric.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Test 
s\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.core\5.2. 
6\lib\net45\System.Web.Http.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration 
.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.owin\5.2. 
6\lib\net45\System.Web.Http.Owin.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integr 
ation.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:         C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.core\5.2.6\li 
b\net45\System.Web.Http.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tes 
ts.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\sky\ 
.nuget\packages\microsoft.aspnet.webapi.core\5.2.6\lib\net45\System.Web.Http.dll". [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integrati 
on.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.core\5.2. 
6\lib\net45\System.Web.Http.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration 
.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask 
.AzureServiceFabric\bin\x64\Debug\net462\DurableTask.AzureServiceFabric.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Test 
s\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.owin\5.2. 
6\lib\net45\System.Web.Http.Owin.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integr 
ation.Tests.csproj]
  TestApplication.StatefulService -> C:\Users\sky\work\code\durabletask\durabletask\test\TestFabricApplication\TestApplication.StatefulService\bin\Debug\net472\TestApplication.
  StatefulService.exe
  DurableTask.Emulator.Tests -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.Emulator.Tests\bin\Debug\netcoreapp3.1\DurableTask.Emulator.Tests.dll
  Correlation.Samples -> C:\Users\sky\work\code\durabletask\durabletask\samples\Correlation.Samples\bin\Debug\netcoreapp3.1\Correlation.Samples.dll
  The package Microsoft.Azure.DurableTask.AzureServiceFabric.2.3.11 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why package readmes
   are important.
  Successfully created package 'C:\Users\sky\work\code\durabletask\durabletask\build_output\packages\Microsoft.Azure.DurableTask.AzureServiceFabric.2.3.11.nupkg'.
  DurableTask.Redis.Tests -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.Redis.Tests\bin\Debug\netcoreapp3.1\DurableTask.Redis.Tests.dll
  Successfully created package 'C:\Users\sky\work\code\durabletask\durabletask\build_output\packages\Microsoft.Azure.DurableTask.AzureServiceFabric.2.3.11.symbols.nupkg'.
  DurableTask.AzureServiceFabric.Integration.Tests -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\bin\x64\Debug\net462\
  DurableTask.AzureServiceFabric.Integration.Tests.dll
C:\Users\sky\work\code\durabletask\durabletask\samples\DistributedTraceSample\OpenTelemetry\Program.cs(100,48): warning CS1998: This async method lacks 'await' operators and wi
ll run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [C:\Users\sky\w
ork\code\durabletask\durabletask\samples\DistributedTraceSample\OpenTelemetry\OpenTelemetrySample.csproj]
  DurableTask.ServiceBus.Tests -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.ServiceBus.Tests\bin\Debug\netcoreapp3.1\DurableTask.ServiceBus.Tests.dll
  OpenTelemetrySample -> C:\Users\sky\work\code\durabletask\durabletask\samples\DistributedTraceSample\OpenTelemetry\bin\Debug\net6.0\OpenTelemetrySample.dll
  ApplicationInsightsSample -> C:\Users\sky\work\code\durabletask\durabletask\samples\DistributedTraceSample\ApplicationInsights\bin\Debug\net6.0\ApplicationInsightsSample.dll
  DurableTask.Stress.Tests -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.Stress.Tests\bin\Debug\netcoreapp3.1\DurableTask.Stress.Tests.dll
  DurableTask.Core.Tests -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.Core.Tests\bin\Debug\netcoreapp3.1\DurableTask.Core.Tests.dll
  DurableTask.Stress.Tests -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.Stress.Tests\bin\Debug\net462\DurableTask.Stress.Tests.exe
  DurableTask.Samples -> C:\Users\sky\work\code\durabletask\durabletask\samples\DurableTask.Samples\bin\Debug\net462\DurableTask.Samples.exe
  The package Microsoft.Azure.DurableTask.AzureStorage.1.17.1 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why package readmes are i
  mportant.
  Successfully created package 'C:\Users\sky\work\code\durabletask\durabletask\build_output\packages\Microsoft.Azure.DurableTask.AzureStorage.1.17.1.nupkg'.
  DurableTask.AzureStorage.Tests -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureStorage.Tests\bin\Debug\netcoreapp3.1\DurableTask.AzureStorage.Tests.dl
  l
  DurableTask.AzureStorage.Tests -> C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureStorage.Tests\bin\Debug\net462\DurableTask.AzureStorage.Tests.dll

Build succeeded.

C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' is  
out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\ 
sky\work\code\durabletask\durabletask\samples\Correlation.Samples\Correlation.Samples.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' is  
out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\ 
sky\work\code\durabletask\durabletask\test\DurableTask.Stress.Tests\DurableTask.Stress.Tests.csproj::TargetFramework=netcoreapp3.1]
C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' is  
out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\ 
sky\work\code\durabletask\durabletask\test\DurableTask.Stress.Tests\DurableTask.Stress.Tests.csproj::TargetFramework=netcoreapp3.1]
C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' is  
out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\ 
sky\work\code\durabletask\durabletask\samples\Correlation.Samples\Correlation.Samples.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277: Found conflicts between different versions of "Newtonsoft.Json" that could 
 not be resolved. [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj] 
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277: There was a conflict between "Newtonsoft.Json, Version=7.0.0.0, Culture=ne 
utral, PublicKeyToken=30ad4fe6b2a6aeed" and "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed". [C:\Users\sky\work\code\durabletask\durableta 
sk\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:     "Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30a 
d4fe6b2a6aeed" was chosen because it was primary and "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" was not. [C:\Users\sky\work\code\dura 
bletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:     References which depend on "Newtonsoft.Json, Version=7.0.0.0, Culture= 
neutral, PublicKeyToken=30ad4fe6b2a6aeed" [C:\Users\sky\.nuget\packages\newtonsoft.json\7.0.1\lib\net45\Newtonsoft.Json.dll]. [C:\Users\sky\work\code\durabletask\durabletask\te 
st\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:         C:\Users\sky\.nuget\packages\newtonsoft.json\7.0.1\lib\net45\Newto 
nsoft.Json.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]    
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\sky\ 
.nuget\packages\newtonsoft.json\7.0.1\lib\net45\Newtonsoft.Json.dll". [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\Dura 
bleTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\.nuget\packages\newtonsoft.json\7.0.1\lib\net45\N 
ewtonsoft.Json.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj 
]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:     References which depend on or have been unified to "Newtonsoft.Json, V 
ersion=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" []. [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\Dur 
ableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:         C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Cor 
e\bin\Debug\net462\DurableTask.Core.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Int 
egration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\sky\ 
work\code\durabletask\durabletask\src\DurableTask.Core\bin\Debug\net462\DurableTask.Core.dll". [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabr 
ic.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask 
.Core\bin\Debug\net462\DurableTask.Core.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric 
.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\test\DurableTas 
k.Test.Orchestrations\bin\Debug\net462\DurableTask.Test.Orchestrations.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests 
\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask 
.AzureServiceFabric\bin\x64\Debug\net462\DurableTask.AzureServiceFabric.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Test 
s\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\test\TestFabric 
Application\TestApplication.Common\bin\x64\Debug\net462\TestApplication.Common.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integrati 
on.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:         C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Azu 
reServiceFabric\bin\x64\Debug\net462\DurableTask.AzureServiceFabric.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\Du 
rableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\sky\ 
work\code\durabletask\durabletask\src\DurableTask.AzureServiceFabric\bin\x64\Debug\net462\DurableTask.AzureServiceFabric.dll". [C:\Users\sky\work\code\durabletask\durabletask\t 
est\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask 
.AzureServiceFabric\bin\x64\Debug\net462\DurableTask.AzureServiceFabric.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Test 
s\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:         C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.client\5.2.6\ 
lib\net45\System.Net.Http.Formatting.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.In 
tegration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\sky\ 
.nuget\packages\microsoft.aspnet.webapi.client\5.2.6\lib\net45\System.Net.Http.Formatting.dll". [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFab 
ric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.client\5. 
2.6\lib\net45\System.Net.Http.Formatting.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabri
c.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask 
.AzureServiceFabric\bin\x64\Debug\net462\DurableTask.AzureServiceFabric.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Test 
s\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.core\5.2. 
6\lib\net45\System.Web.Http.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration 
.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.owin\5.2. 
6\lib\net45\System.Web.Http.Owin.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integr 
ation.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:         C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.core\5.2.6\li 
b\net45\System.Web.Http.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration.Tes 
ts.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\sky\ 
.nuget\packages\microsoft.aspnet.webapi.core\5.2.6\lib\net45\System.Web.Http.dll". [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integrati 
on.Tests\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.core\5.2. 
6\lib\net45\System.Web.Http.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integration 
.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask 
.AzureServiceFabric\bin\x64\Debug\net462\DurableTask.AzureServiceFabric.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Test 
s\DurableTask.AzureServiceFabric.Integration.Tests.csproj]
C:\Program Files\dotnet\sdk\8.0.203\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3277:             C:\Users\sky\.nuget\packages\microsoft.aspnet.webapi.owin\5.2. 
6\lib\net45\System.Web.Http.Owin.dll [C:\Users\sky\work\code\durabletask\durabletask\test\DurableTask.AzureServiceFabric.Integration.Tests\DurableTask.AzureServiceFabric.Integr 
ation.Tests.csproj]
C:\Users\sky\work\code\durabletask\durabletask\samples\DistributedTraceSample\OpenTelemetry\Program.cs(100,48): warning CS1998: This async method lacks 'await' operators and wi 
ll run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [C:\Users\sky\w 
ork\code\durabletask\durabletask\samples\DistributedTraceSample\OpenTelemetry\OpenTelemetrySample.csproj]
    6 Warning(s)
    0 Error(s)

Time Elapsed 00:00:05.24

2.2 - 运行单元测试

运行 Durable Task 项目的单元测试

2.2.1 - 运行单元测试的准备工作

运行 Durable Task 单元测试的准备工作

运行单元测试的准备工作

https://github.com/Azure/durabletask#development-notes

To run unit tests, you must specify your Service Bus connection string for the tests to use. You can do this via the ServiceBusConnectionString app.config value in the test project, or by defining a DurableTaskTestServiceBusConnectionString environment variable. The benefit of the environment variable is that no temporary source changes are required.

要运行单元测试,您必须指定 Service Bus 连接字符串供测试使用。您可以通过测试项目中的 ServiceBusConnectionString app.config值,或通过定义 DurableTaskTestServiceBusConnectionString 环境变量来做到这一点。使用环境变量的好处是无需临时更改源代码。

Unit tests also require Azure Storage Emulator, so make sure it’s installed and running.

单元测试还需要 Azure Storage Emulator,因此请确保它已安装并正在运行。

Note: While it’s possible to use in tests a real Azure Storage account it is not recommended to do so because many tests will fail with a 409 Conflict error. This is because tests delete and quickly recreate the same storage tables, and Azure Storage doesn’t do well in these conditions. If you really want to change Azure Storage connection string you can do so via the StorageConnectionString app.config value in the test project, or by defining a DurableTaskTestStorageConnectionString environment variable.

注意:虽然可以在测试中使用真实的 Azure Storage 帐户,但不建议这样做,因为许多测试会因 409 Conflict 错误而失败。这是因为测试会删除并快速重新创建相同的存储表,而 Azure Storage 在这种情况下表现不佳。如果真的要更改 Azure Storage 连接字符串,可以通过测试项目中的 StorageConnectionString app.config 值,或通过定义 DurableTaskTestStorageConnectionString 环境变量来实现。

修改

StorageConnectionString 有在两个地方进行定义,默认值都是空

  • Test\DurableTask.Core.Tests\app.config
  • Test\DurableTask.ServiceBus.Tests\app.config

还是定义环境变量会更合适

export DurableTaskTestStorageConnectionString=""

Azure Storage Emulator

使用文档:使用 Azure 存储模拟器进行开发和测试(已弃用)

下载并安装

https://go.microsoft.com/fwlink/?linkid=717179&clcid=0x409

若要启动 Azure 存储模拟器:

  1. 选择“开始”按钮或按“Windows”键。
  2. 开始键入 Azure Storage Emulator
  3. 从所示应用程序的列表中选择该模拟器。

Azurite

在 Visual Studio Code 中,选择“扩展”图标并搜索“Azurite”。 选择“安装”按钮以安装 Azurite 扩展。

2.2.2 - 运行单元测试

运行 Durable Task 单元测试

DurableTask.Core.Tests

路径为 Test/DurableTask.Core.Tests,不需要启动模拟器或者设置 service bus 连接,直接运行:

dotnet test Test/DurableTask.Core.Tests/DurableTask.Core.Tests.csproj

输出为:

  Determining projects to restore...
  All projects are up-to-date for restore.
  DurableTask.Core -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Core\bin\Debug\netstandard2.0\DurableTask.Core.dll
  DurableTask.Core -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Core\bin\Debug\net462\DurableTask.Core.dll
  DurableTask.Emulator -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Emulator\bin\Debug\netstandard2.0\DurableTask.Emulator.dll
  DurableTask.Test.Orchestrations -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Test.Orchestrations\bin\Debug\netstandard2.0\DurableTask.Test.Orchestrati
  ons.dll
  DurableTask.Emulator -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Emulator\bin\Debug\net462\DurableTask.Emulator.dll
  DurableTask.Test.Orchestrations -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Test.Orchestrations\bin\Debug\net462\DurableTask.Test.Orchestrations.dll
  DurableTask.Core.Tests -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Core.Tests\bin\Debug\netcoreapp3.1\DurableTask.Core.Tests.dll
  DurableTask.Core.Tests -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Core.Tests\bin\Debug\net462\DurableTask.Core.Tests.dll
Test run for C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Core.Tests\bin\Debug\netcoreapp3.1\DurableTask.Core.Tests.dll (.NETCoreApp,Version=v3.1)
Microsoft (R) Test Execution Command Line Tool Version 17.9.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:    59, Skipped:     0, Total:    59, Duration: 21 s - DurableTask.Core.Tests.dll (netcoreapp3.1)
Test run for C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Core.Tests\bin\Debug\net462\DurableTask.Core.Tests.dll (.NETFramework,Version=v4.6.2)
Microsoft (R) Test Execution Command Line Tool Version 17.9.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:    59, Skipped:     0, Total:    59, Duration: 21 s - DurableTask.Core.Tests.dll (net462)

DurableTask.Redis.Tests

dotnet test Test/DurableTask.Redis.Tests/DurableTask.Redis.Tests.csproj

报错无法连接 redis 服务器:

dotnet test Test/DurableTask.Redis.Tests/DurableTask.Redis.Tests.csproj
  Determining projects to restore...
  Restored C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Redis.Tests\DurableTask.Redis.Tests.csproj (in 329 ms).
  2 of 3 projects are up-to-date for restore.
  DurableTask.Core -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Core\bin\Debug\netstandard2.0\DurableTask.Core.dll
  DurableTask.Redis -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Redis\bin\Debug\netstandard2.0\DurableTask.Redis.dll
  The package Microsoft.Azure.DurableTask.Redis.0.1.9-alpha is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why package readmes are i
  mportant.
  Successfully created package 'C:\Users\sky\work\code\durabletask\durabletask\build_output\packages\Microsoft.Azure.DurableTask.Redis.0.1.9-alpha.nupkg'.
  DurableTask.Redis.Tests -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Redis.Tests\bin\Debug\netcoreapp3.1\DurableTask.Redis.Tests.dll
Test run for C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Redis.Tests\bin\Debug\netcoreapp3.1\DurableTask.Redis.Tests.dll (.NETCoreApp,Version=v3.1)
Microsoft (R) Test Execution Command Line Tool Version 17.9.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:13.73]     DurableTask.Redis.Tests.EndToEndServiceScenarioTests.SimpleFanOutOrchestration [FAIL]
  Failed DurableTask.Redis.Tests.EndToEndServiceScenarioTests.SimpleFanOutOrchestration [13 s]
  Error Message:
   StackExchange.Redis.RedisConnectionException : It was not possible to connect to the redis server(s). UnableToConnect on localhost:6379/Interactive, Initializing, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 11s ago, v: 2.0.571.20511
  Stack Trace:
     at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(Object configuration, TextWriter log) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 825
   at DurableTask.Redis.RedisOrchestrationService.DeleteAsync() in C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Redis\RedisOrchestrationService.cs:line 267  
   at DurableTask.Redis.Tests.EndToEndServiceScenarioTests.SimpleFanOutOrchestration() in C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Redis.Tests\EndToEndServiceScenarioTests.cs:line 148
--- End of stack trace from previous location where exception was thrown ---
[xUnit.net 00:00:21.90]     DurableTask.Redis.Tests.EndToEndServiceScenarioTests.ScheduledStart_NotSupported [FAIL]
  Failed DurableTask.Redis.Tests.EndToEndServiceScenarioTests.ScheduledStart_NotSupported [8 s]
  Error Message:
   StackExchange.Redis.RedisConnectionException : It was not possible to connect to the redis server(s). UnableToConnect on localhost:6379/Interactive, Initializing, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 19s ago, v: 2.0.571.20511
  Stack Trace:
     at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(Object configuration, TextWriter log) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 825
   at DurableTask.Redis.RedisOrchestrationService.DeleteAsync() in C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Redis\RedisOrchestrationService.cs:line 267  
   at DurableTask.Redis.Tests.EndToEndServiceScenarioTests.ScheduledStart_NotSupported() in C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Redis.Tests\EndToEndServiceScenarioTests.cs:line 229
--- End of stack trace from previous location where exception was thrown ---
[xUnit.net 00:00:30.14]     DurableTask.Redis.Tests.EndToEndServiceScenarioTests.SimpleFanOutOrchestration_DurabilityTest [FAIL]
  Failed DurableTask.Redis.Tests.EndToEndServiceScenarioTests.SimpleFanOutOrchestration_DurabilityTest [8 s]
  Error Message:
   StackExchange.Redis.RedisConnectionException : It was not possible to connect to the redis server(s). UnableToConnect on localhost:6379/Interactive, Initializing, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 27s ago, v: 2.0.571.20511
  Stack Trace:
     at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(Object configuration, TextWriter log) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 825
   at DurableTask.Redis.RedisOrchestrationService.DeleteAsync() in C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Redis\RedisOrchestrationService.cs:line 267  
   at DurableTask.Redis.Tests.EndToEndServiceScenarioTests.SimpleFanOutOrchestration_DurabilityTest() in C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Redis.Tests\EndToEndServiceScenarioTests.cs:line 202
--- End of stack trace from previous location where exception was thrown ---
[xUnit.net 00:00:34.23]     DurableTask.Redis.Tests.EndToEndServiceScenarioTests.DeleteTaskHub_DeletesAllKeysInRelevantNamespace [FAIL]
  Failed DurableTask.Redis.Tests.EndToEndServiceScenarioTests.DeleteTaskHub_DeletesAllKeysInRelevantNamespace [4 s]
  Error Message:
   StackExchange.Redis.RedisConnectionException : It was not possible to connect to the redis server(s). UnableToConnect on localhost:6379/Interactive, Initializing, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 31s ago, v: 2.0.571.20511
  Stack Trace:
     at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(Object configuration, TextWriter log) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 825
   at DurableTask.Redis.Tests.TestHelpers.GetRedisConnection() in C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Redis.Tests\TestHelpers.cs:line 39
   at DurableTask.Redis.Tests.EndToEndServiceScenarioTests.DeleteTaskHub_DeletesAllKeysInRelevantNamespace() in C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Redis.Tests\EndToEndServiceScenarioTests.cs:line 31
--- End of stack trace from previous location where exception was thrown ---
[xUnit.net 00:00:42.37]     DurableTask.Redis.Tests.EndToEndServiceScenarioTests.SimpleGreetingOrchestration [FAIL]
  Failed DurableTask.Redis.Tests.EndToEndServiceScenarioTests.SimpleGreetingOrchestration [8 s]
  Error Message:
   StackExchange.Redis.RedisConnectionException : It was not possible to connect to the redis server(s). UnableToConnect on localhost:6379/Interactive, Initializing, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 39s ago, v: 2.0.571.20511
  Stack Trace:
     at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(Object configuration, TextWriter log) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 825
   at DurableTask.Redis.RedisOrchestrationService.DeleteAsync() in C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Redis\RedisOrchestrationService.cs:line 267  
   at DurableTask.Redis.Tests.EndToEndServiceScenarioTests.SimpleGreetingOrchestration() in C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Redis.Tests\EndToEndServiceScenarioTests.cs:line 110
--- End of stack trace from previous location where exception was thrown ---

Failed!  - Failed:     5, Passed:     6, Skipped:     0, Total:    11, Duration: 41 s - DurableTask.Redis.Tests.dll (netcoreapp3.1)

DurableTask.Emulator.Tests

不需要启动模拟器或者设置 service bus 连接,直接运行:

dotnet test Test/DurableTask.Emulator.Tests/DurableTask.Emulator.Tests.csproj

输出为:

dotnet test Test/DurableTask.Emulator.Tests/DurableTask.Emulator.Tests.csproj 
  Determining projects to restore...
  Restored C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Test.Orchestrations\DurableTask.Test.Orchestrations.csproj (in 192 ms).
  Restored C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Emulator.Tests\DurableTask.Emulator.Tests.csproj (in 192 ms).
  2 of 4 projects are up-to-date for restore.
  DurableTask.Core -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Core\bin\Debug\netstandard2.0\DurableTask.Core.dll
  DurableTask.Core -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Core\bin\Debug\net462\DurableTask.Core.dll
  DurableTask.Emulator -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Emulator\bin\Debug\net462\DurableTask.Emulator.dll
  DurableTask.Test.Orchestrations -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Test.Orchestrations\bin\Debug\net462\DurableTask.Test.Orchestrations.dll
  DurableTask.Emulator -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Emulator\bin\Debug\netstandard2.0\DurableTask.Emulator.dll
  DurableTask.Emulator.Tests -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Emulator.Tests\bin\Debug\net462\DurableTask.Emulator.Tests.dll
  DurableTask.Test.Orchestrations -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Test.Orchestrations\bin\Debug\netstandard2.0\DurableTask.Test.Orchestrati
  ons.dll
  DurableTask.Emulator.Tests -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Emulator.Tests\bin\Debug\netcoreapp3.1\DurableTask.Emulator.Tests.dll
Test run for C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Emulator.Tests\bin\Debug\net462\DurableTask.Emulator.Tests.dll (.NETFramework,Version=v4.6.2)
Microsoft (R) Test Execution Command Line Tool Version 17.9.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:     5, Skipped:     0, Total:     5, Duration: 34 s - DurableTask.Emulator.Tests.dll (net462)
Test run for C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Emulator.Tests\bin\Debug\netcoreapp3.1\DurableTask.Emulator.Tests.dll (.NETCoreApp,Version=v3.1)
Microsoft (R) Test Execution Command Line Tool Version 17.9.0 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:     5, Skipped:     0, Total:     5, Duration: 32 s - DurableTask.Emulator.Tests.dll (netcoreapp3.1)

DurableTask.Samples.Tests

dotnet test Test/DurableTask.Samples.Tests/DurableTask.Samples.Tests.csproj 
  Determining projects to restore...
C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Samples.Tests\DurableTask.Samples.Tests.csproj : error NU1201: Project DurableTask.Samples is not compatible w
ith net451 (.NETFramework,Version=v4.5.1). Project DurableTask.Samples supports: net462 (.NETFramework,Version=v4.6.2)
  Failed to restore C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Samples.Tests\DurableTask.Samples.Tests.csproj (in 4.15 sec).
  3 of 4 projects are up-to-date for restore.

DurableTask.ServiceBus.Tests

dotnet test Test/DurableTask.ServiceBus.Tests/DurableTask.ServiceBus.Tests.csproj

必须设置 service bus 连接,否则报错:

  Failed GenerationSubNoCompressionTest [< 1 ms]
  Error Message:
   Initialization method DurableTask.ServiceBus.Tests.FunctionalTests.TestInitialize threw exception. System.TypeInitializationException: The type initializer for 'DurableTask.ServiceBus.Tests.TestHelpers' threw an exception. ---> System.ArgumentException: A ServiceBus connection string must be defined in either an environment variable or in configuration..

DurableTask.SqlServer.Tests

dotnet test Test/DurableTask.SqlServer.Tests/DurableTask.SqlServer.Tests.csproj
dotnet test Test/DurableTask.SqlServer.Tests/DurableTask.SqlServer.Tests.csproj
  Determining projects to restore...
C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.SqlServer.Tests\DurableTask.SqlServer.Tests.csproj : error NU1903: Warning As Error: Package 'System.Data.SqlC
lient' 4.8.5 has a known high severity vulnerability, https://github.com/advisories/GHSA-98g6-xh36-x2p7
  Failed to restore C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.SqlServer.Tests\DurableTask.SqlServer.Tests.csproj (in 280 ms).
  2 of 3 projects are up-to-date for restore.

DurableTask.Stress.Tests

dotnet test Test/DurableTask.Stress.Tests/DurableTask.Stress.Tests.csproj 

没有测试类:

dotnet test Test/DurableTask.Stress.Tests/DurableTask.Stress.Tests.csproj 
  Determining projects to restore...
C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' i
s out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Us
ers\sky\work\code\durabletask\durabletask\Test\DurableTask.Stress.Tests\DurableTask.Stress.Tests.csproj::TargetFramework=netcoreapp3.1]
  Restored C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Stress.Tests\DurableTask.Stress.Tests.csproj (in 521 ms).
  3 of 4 projects are up-to-date for restore.
C:\Program Files\dotnet\sdk\8.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(32,5): warning NETSDK1138: The target framework 'netcoreapp3.1' i
s out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Us 
ers\sky\work\code\durabletask\durabletask\Test\DurableTask.Stress.Tests\DurableTask.Stress.Tests.csproj::TargetFramework=netcoreapp3.1]
  DurableTask.Core -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Core\bin\Debug\netstandard2.0\DurableTask.Core.dll
  DurableTask.Core -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Core\bin\Debug\net462\DurableTask.Core.dll
  DurableTask.Test.Orchestrations -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Test.Orchestrations\bin\Debug\netstandard2.0\DurableTask.Test.Orchestrati
  ons.dll
  DurableTask.AzureStorage -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.AzureStorage\bin\Debug\netstandard2.0\DurableTask.AzureStorage.dll
  DurableTask.Test.Orchestrations -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Test.Orchestrations\bin\Debug\net462\DurableTask.Test.Orchestrations.dll
  DurableTask.AzureStorage -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.AzureStorage\bin\Debug\net462\DurableTask.AzureStorage.dll
  DurableTask.Stress.Tests -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Stress.Tests\bin\Debug\net462\DurableTask.Stress.Tests.exe
  DurableTask.Stress.Tests -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Stress.Tests\bin\Debug\netcoreapp3.1\DurableTask.Stress.Tests.dll

DurableTask.Test.Orchestrations

dotnet test Test/DurableTask.Test.Orchestrations/DurableTask.Test.Orchestrations.csproj 
  Determining projects to restore...
  All projects are up-to-date for restore.
  DurableTask.Core -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Core\bin\Debug\netstandard2.0\DurableTask.Core.dll
  DurableTask.Core -> C:\Users\sky\work\code\durabletask\durabletask\src\DurableTask.Core\bin\Debug\net462\DurableTask.Core.dll
  DurableTask.Test.Orchestrations -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Test.Orchestrations\bin\Debug\netstandard2.0\DurableTask.Test.Orchestrati
  ons.dll
  DurableTask.Test.Orchestrations -> C:\Users\sky\work\code\durabletask\durabletask\Test\DurableTask.Test.Orchestrations\bin\Debug\net462\DurableTask.Test.Orchestrations.dll

2.3 - 运行示例

运行 Durable Task 项目的示例

3 - durabletask-dotnet项目

搭建durabletask-dotnet项目的开发环境

3.1 - 构建项目

构建 DurableTask-dotnet 项目

https://github.com/microsoft/durabletask-dotnet

获取源码

# cd ~/work/code/durabletask
git clone git@github.com:microsoft/durabletask-dotnet.git
git submodule update --init --recursive
# git submodule update --remote

当 submodule 有内容更新时,也就是说 durabletask-protobuf 项目有更新,则需要更新 submodule 的内容,需要执行:

git submodule update --remote

输出结果为:

remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 4 (delta 2), reused 4 (delta 2), pack-reused 0
Unpacking objects: 100% (4/4), 431 bytes | 86.00 KiB/s, done.
From https://github.com/skyao/durabletask-protobuf  
   5f49779..6466c8c  versioning -> origin/versioning
Submodule path 'eng/proto': checked out '6466c8c4a35a4bcdd15dabcb499b4c71d83e8dd1'

这里 checked out 最新的代码更新。

执行 build

在终端执行命令:

# cd ~/work/code/durabletask/durabletask-dotnet
dotnet build

输出如下:

dotnet build
适用于 .NET MSBuild 版本 17.9.6+a4ecab324
  正在确定要还原的项目…
  所有项目均是最新的,无法还原。
  TestHelpers -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\TestHelpers\netstandard2.0\Microsoft.DurableTask.TestHelpers.dll
  Grpc -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Grpc\netstandard2.0\Microsoft.DurableTask.Grpc.dll
  ConsoleApp -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\samples\bin\Debug\ConsoleApp\net6.0\Samples.ConsoleApp.dll
  Generators -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Generators\netstandard2.0\Microsoft.DurableTask.Generators.dll
  Abstractions -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Abstractions\netstandard2.0\Microsoft.DurableTask.Abstractions.dll
  NetFxConsoleApp -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\samples\bin\Debug\NetFxConsoleApp\net48\Samples.NetFxConsoleApp.exe
  Grpc -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Grpc\net6.0\Microsoft.DurableTask.Grpc.dll
  AzureFunctionsApp -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\samples\bin\Debug\AzureFunctionsApp\net6.0\Samples.AzureFunctionsApp.dll
  Worker -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Worker\netstandard2.0\Microsoft.DurableTask.Worker.dll
  Client -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Client\netstandard2.0\Microsoft.DurableTask.Client.dll
  Generators.Tests -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Generators.Tests\net6.0\Microsoft.DurableTask.Generators.Tests.dll
  Abstractions.Tests -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Abstractions.Tests\net6.0\Microsoft.DurableTask.Abstractions.Tests.dll
  Worker.Grpc -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Worker.Grpc\netstandard2.0\Microsoft.DurableTask.Worker.Grpc.dll
  Worker.Grpc -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Worker.Grpc\net6.0\Microsoft.DurableTask.Worker.Grpc.dll
  Benchmarks -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Benchmarks\net6.0\Benchmarks.dll
  Client.Grpc -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Client.Grpc\netstandard2.0\Microsoft.DurableTask.Client.Grpc.dll
  Client.Grpc -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Client.Grpc\net6.0\Microsoft.DurableTask.Client.Grpc.dll
  Client.Tests -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Client.Tests\net6.0\Microsoft.DurableTask.Client.Tests.dll
  Client.OrchestrationServiceClientShim -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Client.OrchestrationServiceClientShim\netstandard2.0\Microsoft.DurableTask.Client.OrchestrationServiceClientShim.dll
  Worker.Tests -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Worker.Tests\net6.0\Microsoft.DurableTask.Worker.Tests.dll
  Client.OrchestrationServiceClientShim.Tests -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Client.OrchestrationServiceClientShim.Tests\net6.0\Microsoft.DurableTask.Client.OrchestrationServiceClientShim.Tests.dll
  正在确定要还原的项目…
  Grpc.IntegrationTests -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Grpc.IntegrationTests\net6.0\Microsoft.DurableTask.Grpc.IntegrationTests.dll
  Client.Grpc.Tests -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Client.Grpc.Tests\net6.0\Microsoft.DurableTask.Client.Grpc.Tests.dll
  Worker.Grpc.Tests -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\bin\Debug\Worker.Grpc.Tests\net6.0\Microsoft.DurableTask.Worker.Grpc.Tests.dll
  WebAPI -> C:\Users\sky\work\code\durabletask\durabletask-dotnet\out\samples\bin\Debug\WebAPI\net6.0\Samples.WebAPI.dll
  已还原 C:\Users\sky\AppData\Local\Temp\n4zwr33f.gin\WorkerExtensions.csproj (用时 300 ms)  WorkerExtensions -> C:\Users\sky\AppData\Local\Temp\n4zwr33f.gin\buildout\Microsoft.Azure.Functions.Worker.Extensions.dll

已成功生成。
    0 个警告
    0 个错误

已用时间 00:00:02.01

4 - azure-functions-durable-extension项目

搭建azure-functions-durable-extension项目的开发环境

4.1 - 构建项目

构建 azure-functions-durable-extension 项目

https://github.com/Azure/azure-functions-durable-extension

获取源码

# cd ~/work/code/durabletask
git clone git@github.com:Azure/azure-functions-durable-extension.git

执行 build

注意:azure-functions-durable-extension 项目需要 .net 2.1

C:\Users\sky\.nuget\packages\microsoft.net.sdk.functions\1.0.30\build\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : To install missing framework, download: [C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\DFPerfScenariosV1\DFPerfScenariosV1.csproj]
C:\Users\sky\.nuget\packages\microsoft.net.sdk.functions\1.0.30\build\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.1.0&arch=x64&rid=win-x64&os=win10 [C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\DFPerfScenariosV1\DFPerfScenariosV1.csproj]

在终端执行命令:

# cd ~/work/code/durabletask/azure-functions-durable-extension
dotnet build

输出如下:

dotnet build
适用于 .NET MSBuild 版本 17.9.6+a4ecab324
  正在确定要还原的项目…
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\SmokeTests\SmokeTestsV1\VSSampleV1.csproj : warning NU1903: Package 'Newtonsoft.Json' 9.0.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5crp-9r3c-p9vr [C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\WebJobs.Extensions.DurableTask.sln]
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\WebJobs.Extensions.DurableTask.sln]
  所有项目均是最新的,无法还原。
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\SmokeTests\SmokeTestsV1\VSSampleV1.csproj : warning NU1903: Package 'Newtonsoft.Json' 9.0.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5crp-9r3c-p9vr
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [TargetFramework=netcoreapp3.1]
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [TargetFramework=netstandard2.0]
  WebJobs.Extensions.DurableTask.Analyzers -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask.Analyzers\bin\Debug\netstandard2.0\Microsoft.Azure.WebJobs.Extensions.DurableTask.Analyzers.dll
  DurableFunctions.TypedInterfaces -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\DurableFunctions.TypedInterfaces\SourceGenerator\bin\Debug\netstandard2.0\DurableFunctions.TypedInterfaces.dll
  Worker.Extensions.DurableTask -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\Worker.Extensions.DurableTask\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker.Extensions.DurableTask.dll
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [TargetFramework=net462]
  Worker.Extensions.DurableTask -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\Worker.Extensions.DurableTask\bin\Debug\net6.0\Microsoft.Azure.Functions.Worker.Extensions.DurableTask.dll
  WebJobs.Extensions.DurableTask -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\bin\Debug\netstandard2.0\Microsoft.Azure.WebJobs.Extensions.DurableTask.dll
  WebJobs.Extensions.DurableTask -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\bin\Debug\netcoreapp3.1\Microsoft.Azure.WebJobs.Extensions.DurableTask.dll
  WebJobs.Extensions.DurableTask -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\bin\Debug\net462\Microsoft.Azure.WebJobs.Extensions.DurableTask.dll
  WebJobs.Extensions.DurableTask.Analyzers.Test -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\WebJobs.Extensions.DurableTask.Analyzers.Test\bin\Debug\net6.0\Microsoft.Azure.WebJobs.Extensions.DurableTask.Analyzers.Test.dll
  extensions -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\TimeoutTests\Python\bin\Debug\netstandard2.0\extensions.dll
  DFPerfScenariosV4 -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\DFPerfScenarios\bin\Debug\net60\DFPerfScenariosV4.dll
  VSSampleV3 -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\SmokeTests\SmokeTestsV3\bin\Debug\netcoreapp3.1\VSSampleV3.dll
  WebJobs.Extensions.DurableTask.Tests.V2 -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\FunctionsV2\bin\Debug\net6.0\WebJobs.Extensions.DurableTask.Tests.V2.dll
  VSSampleV1 -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\SmokeTests\SmokeTestsV1\bin\Debug\net462\bin\VSSampleV1.dll
  DFPerfScenariosV1 -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\DFPerfScenariosV1\bin\Debug\net462\bin\DFPerfScenariosV1.dll
  WebJobs.Extensions.DurableTask.Tests.V1 -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\FunctionsV1\bin\Debug\net462\WebJobs.Extensions.DurableTask.Tests.V1.dll
  DurableFunctions.TypedInterfaces.SourceGenerator.Test -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\CodeGen.SourceGenerator.Test\bin\Debug\net6.0\DurableFunctions.TypedInterfaces.SourceGenerator.Test.dll
  DurableFunctions.TypedInterfaces.Example -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\DurableFunctions.TypedInterfaces\Example\bin\Debug\net6.0\DurableFunctions.TypedInterfaces.Example.dll
  VSSampleV2 -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\SmokeTests\SmokeTestsV2\bin\Debug\netstandard2.0\bin\VSSampleV2.dll
  TimeoutTests -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\TimeoutTests\CSharp\bin\Debug\netstandard2.0\TimeoutTests.dll
  extensions -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\SmokeTests\OOProcSmokeTests\durableJS\bin\Debug\netstandard2.0\extensions.dll
  extensions -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\SmokeTests\OOProcSmokeTests\durablePy\bin\Debug\netstandard2.0\extensions.dll
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [TargetFramework=net462]
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [TargetFramework=netcoreapp3.1]
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [TargetFramework=netstandard2.0]
  DurableFunctions.TypedInterfaces.Examples.Test -> C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\CodeGen.Example.Test\bin\Debug\net6.0\DurableFunctions.TypedInterfaces.Examples.Test.dll

已成功生成。

C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\SmokeTests\SmokeTestsV1\VSSampleV1.csproj : warning NU1903: Package 'Newtonsoft.Json' 9.0.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5crp-9r3c-p9vr [C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\WebJobs.Extensions.DurableTask.sln]
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\WebJobs.Extensions.DurableTask.sln]
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\test\SmokeTests\SmokeTestsV1\VSSampleV1.csproj : warning NU1903: Package 'Newtonsoft.Json' 9.0.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5crp-9r3c-p9vr
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [TargetFramework=netcoreapp3.1]
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [TargetFramework=netstandard2.0]
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [TargetFramework=net462]
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [TargetFramework=net462]
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [TargetFramework=netcoreapp3.1]
C:\Users\sky\work\code\durabletask\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\WebJobs.Extensions.DurableTask.csproj : warning NU1903: Package 'Azure.Identity' 1.1.1 has a known high severity vulnerability, https://github.com/advisories/GHSA-5mfx-4wcx-rv27 [TargetFramework=netstandard2.0]
    9 个警告
    0 个错误

已用时间 00:00:02.03

5 - azure-functions-dotnet-worker项目

搭建azure-functions-dotnet-worker项目的开发环境

5.1 - 构建项目

构建 azure-functions-dotnet-worker 项目

https://github.com/Azure/azure-functions-dotnet-worker

获取源码

# cd ~/work/code/durabletask-fork
git clone git@github.com:Azure/azure-functions-dotnet-worker.git

执行 build

在终端执行命令:

# cd ~/work/code/durabletask-fork/azure-functions-dotnet-worker
dotnet build

输出如下:

dotnet build
适用于 .NET MSBuild 版本 17.9.6+a4ecab324
  正在确定要还原的项目…
  所有项目均是最新的,无法还原。
  Sdk.Analyzers -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\sdk\Sdk.Analyzers\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker.Sdk.Analyzers.dll
  TestUtility -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\TestUtility\bin\Debug\net7.0\Microsoft.Azure.Functions.Tests.TestUtility.dll
  FunctionMetadataLoaderExtension -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\sdk\FunctionMetadataLoaderExtension\bin\Debug\netstandard2.0\Microsoft.Azure.WebJobs.Exten 
  sions.FunctionMetadataLoader.dll
  Worker.Extensions.Abstractions -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.Abstractions\src\bin\Debug\netstandard2.0\Microsoft.Azure.Func
  tions.Worker.Extensions.Abstractions.dll
  Sdk.Generators -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\sdk\Sdk.Generators\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker.Sdk.Generators.dll
  Worker.Extensions.Http.AspNetCore.Analyzers -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.Http.AspNetCore.Analyzers\bin\Debug\netstandard2.
  0\Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.Analyzers.dll
  DependentAssemblyWithFunctions -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\DependentAssemblyWithFunctions\bin\Debug\net7.0\DependentAssemblyWithFunctions.dll     
  DotNetWorker.Core -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\src\DotNetWorker.Core\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker.Core.dll
  CustomMiddleware -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\CustomMiddleware\bin\Debug\net8.0\CustomMiddleware.dll
  DependentAssemblyWithFunctions.NetStandard -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\DependentAssemblyWithFunctions.NetStandard\bin\Debug\netstandard2.0\Depend
  entAssemblyWithFunctions.NetStandard.dll
  Worker.Extensions.Warmup -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.Warmup\src\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker 
  .Extensions.Warmup.dll
  Worker.Extensions.Timer -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.Timer\src\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker.E 
  xtensions.Timer.dll
  Worker.Extensions.RabbitMQ -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.RabbitMQ\src\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Wo
  rker.Extensions.RabbitMQ.dll
  Worker.Extensions.SendGrid -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.SendGrid\src\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Wo 
  rker.Extensions.SendGrid.dll
  Worker.Extensions.SignalRService -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.SignalRService\src\bin\Debug\netstandard2.0\Microsoft.Azure. 
  Functions.Worker.Extensions.SignalRService.dll
  Worker.Extensions.Shared.Tests -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\Worker.Extensions.Shared.Tests\bin\Debug\net7.0\Worker.Extensions.Shared.Tests.dll
  Worker.Extensions.Kafka -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.Kafka\src\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker.E 
  xtensions.Kafka.dll
  正在确定要还原的项目…
  正在确定要还原的项目…
  DotNetWorker.Core -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\src\DotNetWorker.Core\bin\Debug\net5.0\Microsoft.Azure.Functions.Worker.Core.dll
  E2ETests -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\E2ETests\E2ETests\bin\Debug\net7.0\Microsoft.Azure.Functions.Worker.E2ETests.dll
  所有项目均是最新的,无法还原。
  正在确定要还原的项目…
  正在确定要还原的项目…
  正在确定要还原的项目…
  所有项目均是最新的,无法还原。
  Worker.Extensions.EventHubs -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.EventHubs\src\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.
  Worker.Extensions.EventHubs.dll
  Worker.Extensions.Tables -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.Tables\src\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker
  .Extensions.Tables.dll
  Worker.Extensions.Http -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.Http\src\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker.Ext 
  ensions.Http.dll
  Worker.Extensions.Storage.Queues -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.Storage.Queues\src\bin\Debug\netstandard2.0\Microsoft.Azure. 
  Functions.Worker.Extensions.Storage.Queues.dll
  Worker.Extensions.Sample-IncorrectImplementation -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\Worker.Extensions.Sample-IncorrectImplementation\bin\Debug\netstanda
  rd2.0\Worker.Extensions.Sample-IncorrectImplementation.dll
  Worker.Extensions.Sample -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\Worker.Extensions.Sample\bin\Debug\netstandard2.0\Worker.Extensions.Sample.dll
  DotNetWorker.Grpc -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\src\DotNetWorker.Grpc\bin\Debug\net6.0\Microsoft.Azure.Functions.Worker.Grpc.dll
  Worker.Extensions.Rpc -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.Rpc\src\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker.Exten
  sions.Rpc.dll
  WorkerExtensions -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\NetFxWorker\obj\Debug\net48\WorkerExtensions\buildout\Microsoft.Azure.Functions.Worker.Extensions
  .dll
  Worker.Extensions.EventGrid -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.EventGrid\src\bin\Debug\netstandard2.0\Microsoft.Azure.Functions. 
  Worker.Extensions.EventGrid.dll
  所有项目均是最新的,无法还原。
  Worker.Extensions.SignalRService.Tests -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\Worker.Extensions.SignalRService.Tests\bin\Debug\net7.0\Worker.Extensions.Sign
  alRService.Tests.dll
  Sdk -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\sdk\Sdk\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker.Sdk.dll
  WorkerExtensions -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\Configuration\obj\Debug\net8.0\WorkerExtensions\buildout\Microsoft.Azure.Functions.Worker.Extensi 
  ons.dll
  Sdk -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\sdk\Sdk\bin\Debug\net472\Microsoft.Azure.Functions.Worker.Sdk.dll
  所有项目均是最新的,无法还原。
  正在确定要还原的项目…
  Worker.Extensions.Rpc -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.Rpc\src\bin\Debug\net6.0\Microsoft.Azure.Functions.Worker.Extensions.Rp 
  c.dll
  所有项目均是最新的,无法还原。
  Worker.Extensions.CosmosDB -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.CosmosDB\src\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Wo
  rker.Extensions.CosmosDB.dll
  DotNetWorker.Grpc -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\src\DotNetWorker.Grpc\bin\Debug\net5.0\Microsoft.Azure.Functions.Worker.Grpc.dll
  DotNetWorker -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\src\DotNetWorker\bin\Debug\net6.0\Microsoft.Azure.Functions.Worker.dll
  Worker.Extensions.ServiceBus -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.ServiceBus\src\bin\Debug\netstandard2.0\Microsoft.Azure.Function
  s.Worker.Extensions.ServiceBus.dll
  DotNetWorker.ApplicationInsights -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\src\DotNetWorker.ApplicationInsights\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.W 
  orker.ApplicationInsights.dll
  Worker.Extensions.Storage.Blobs -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.Storage.Blobs\src\bin\Debug\netstandard2.0\Microsoft.Azure.Fu 
  nctions.Worker.Extensions.Storage.Blobs.dll
  DotNetWorker.Grpc -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\src\DotNetWorker.Grpc\bin\Debug\net7.0\Microsoft.Azure.Functions.Worker.Grpc.dll
  Worker.Extensions.Rpc.Tests -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\Worker.Extensions.Rpc.Tests\bin\Debug\net7.0\Worker.Extensions.Rpc.Tests.dll
  DotNetWorker -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\src\DotNetWorker\bin\Debug\net7.0\Microsoft.Azure.Functions.Worker.dll
  WorkerExtensions -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\Extensions\obj\Debug\net8.0\WorkerExtensions\buildout\Microsoft.Azure.Functions.Worker.Extensions
  .dll
  SdkE2ETests -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\SdkE2ETests\bin\Debug\net7.0\Microsoft.Azure.Functions.SdkE2ETests.dll
  Worker.Extensions.Rpc.Tests -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\Worker.Extensions.Rpc.Tests\bin\Debug\net48\Worker.Extensions.Rpc.Tests.dll
  WorkerExtensions -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\Net7Worker\obj\Debug\net7.0\WorkerExtensions\buildout\Microsoft.Azure.Functions.Worker.Extensions
  .dll
  Worker.Extensions.Storage -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.Storage\src\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Work
  er.Extensions.Storage.dll
  E2EApp -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\E2ETests\E2EApps\E2EApp\bin\Debug\net8.0\Microsoft.Azure.Functions.Worker.E2EApp.dll
  Sdk.Analyzers.Tests -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\Sdk.Analyzers.Tests\bin\Debug\net7.0\Sdk.Analyzers.Tests.dll
  FunctionApp -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\FunctionApp\bin\Debug\net8.0\FunctionApp.dll
  NetFxWorker -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\NetFxWorker\bin\Debug\net48\NetFxWorker.exe
  正在确定要还原的项目…
  正在确定要还原的项目…
  DotNetWorker.Grpc -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\src\DotNetWorker.Grpc\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker.Grpc.dll
  Configuration -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\Configuration\bin\Debug\net8.0\Configuration.dll
  DotNetWorker -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\src\DotNetWorker\bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker.dll
  已还原 C:\Users\sky\AppData\Local\Temp\1tpad3lw.vns\WorkerExtensions.csproj (用时 550 ms)  WorkerExtensions -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\EntityFramework\obj\Debug\net8.0\WorkerExtensions\buildout\Microsoft.Azure.Functions.Worker.Exten
  sions.dll
  Net7Worker -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\Net7Worker\bin\Debug\net7.0\Net7Worker.dll
  Extensions -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\Extensions\bin\Debug\net8.0\Extensions.dll
  已还原 C:\Users\sky\AppData\Local\Temp\vwl4yy2k.1ac\WorkerExtensions.csproj (用时 394 ms)  已还原 C:\Users\sky\AppData\Local\Temp\finw3nul.fi4\WorkerExtensions.csproj (用时 459 ms)  WorkerExtensions -> C:\Users\sky\AppData\Local\Temp\1tpad3lw.vns\buildout\Microsoft.Azure.Functions.Worker.Extensions.dll
  WorkerExtensions -> C:\Users\sky\AppData\Local\Temp\vwl4yy2k.1ac\buildout\Microsoft.Azure.Functions.Worker.Extensions.dll
  Worker.Extensions.Http.AspNetCore -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\extensions\Worker.Extensions.Http.AspNetCore\src\bin\Debug\net6.0\Microsoft.Azure.Functi
  ons.Worker.Extensions.Http.AspNetCore.dll
  EntityFramework -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\EntityFramework\bin\Debug\net8.0\EntityFramework.dll
  WorkerExtensions -> C:\Users\sky\AppData\Local\Temp\finw3nul.fi4\buildout\Microsoft.Azure.Functions.Worker.Extensions.dll
  DotNetWorker -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\src\DotNetWorker\bin\Debug\net5.0\Microsoft.Azure.Functions.Worker.dll
  DotNetWorkerTests -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\DotNetWorkerTests\bin\Debug\net7.0\Microsoft.Azure.Functions.Worker.Tests.dll
  正在确定要还原的项目…
  SdkTests -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\FunctionMetadataGeneratorTests\bin\Debug\net7.0\Microsoft.Azure.Functions.SdkTests.dll
  所有项目均是最新的,无法还原。
  WorkerExtensions -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\AspNetIntegration\obj\Debug\net8.0\WorkerExtensions\buildout\Microsoft.Azure.Functions.Worker.Ext
  ensions.dll
  Worker.Extensions.Tests -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\Worker.Extensions.Tests\bin\Debug\net7.0\Microsoft.Azure.Functions.Worker.Extensions.Tests.dl
  l
  Worker.Extensions.Http.AspNetCore.Tests -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\extensions\Worker.Extensions.Http.AspNetCore.Tests\bin\Debug\net7.0\Microsoft
  .Azure.Functions.Worker.Extensions.Http.AspNetCore.Tests.dll
  AspNetIntegration -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\samples\AspNetIntegration\bin\Debug\net8.0\AspNetIntegration.dll
  Sdk.Generator.Tests -> C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\test\Sdk.Generator.Tests\bin\Debug\net8.0\Microsoft.Azure.Functions.SdkGeneratorTests.dll

已成功生成。
    0 个警告
    0 个错误

已用时间 00:00:03.17

5.2 - 生成protobuf文件

在 azure-functions-dotnet-worker 项目中更新protobuf并生成代码

参考: https://github.com/Azure/azure-functions-dotnet-worker/tree/main/protos/azure-functions-language-worker-protobuf

准备

grpc.tools

nuget.exe install grpc.tools -Version 2.60.0

Google.Protobuf.Tools

nuget.exe install Google.Protobuf.Tools -Version 3.26.1

准备环境变量和目录

在 windows cmd 下执行:

cd C:\Users\sky\work\code\durabletask-fork\azure-functions-dotnet-worker\protos

set NUGET_PATH="%UserProfile%\.nuget\packages"
set GRPC_TOOLS_PATH=%NUGET_PATH%\grpc.tools\2.60.0\tools\windows_x86
set PROTO_PATH=.\azure-functions-language-worker-protobuf\src\proto
set PROTO=.\azure-functions-language-worker-protobuf\src\proto\FunctionRpc.proto
set PROTOBUF_TOOLS=%NUGET_PATH%\google.protobuf.tools\3.26.1\tools
set MSGDIR=.\Messages

if exist %MSGDIR% rmdir /s /q %MSGDIR%
mkdir %MSGDIR%

set OUTDIR=%MSGDIR%\DotNet
mkdir %OUTDIR%

生成

在 windows cmd 下执行:

%GRPC_TOOLS_PATH%\protoc.exe %PROTO% --csharp_out %OUTDIR% --grpc_out=%OUTDIR% --plugin=protoc-gen-grpc=%GRPC_TOOLS_PATH%\grpc_csharp_plugin.exe --proto_path=%PROTO_PATH% --proto_path=%PROTOBUF_TOOLS%

会得到两个生成的文件:

  • protos\Messages\DotNet\FunctionRpc.cs

  • protos\Messages\DotNet\FunctionRpcGrpc.cs

备注:发现不需要这样生成,直接 dotnet build / dotnet pack 后就会自动更新。