我目前正在嘗試用一些不安全的代碼打包一個 nuget 包來解決問題。它在 MSBuild 上運行良好,因為我可以為它提供以下參數:/p:AllowUnsafeBlocks=true我嘗試了幾種方法來為我的 nuget.exe pack 命令提供相同的參數。".\.nuget\nuget.exe" pack "My.csproj" -Build -IncludeReferencedProjects -Version 02.06.5 -verbosity detailed -suffix UAT -Properties "Configuration=Release AllowUnsafeBlocks=true" ".\.nuget\nuget.exe" pack "My.csproj" -Build -IncludeReferencedProjects -Version 02.06.5 -verbosity detailed -suffix UAT -Properties "Configuration=Release" "AllowUnsafeBlocks=true"我收到以下錯誤:error CS0227: Unsafe code may only appear if compiling with /unsafe編輯:由于解決方案設置良好,它在 VS 中也運行良好:)
1 回答

慕碼人2483693
TA貢獻1860條經驗 獲得超9個贊
解決方案非常簡單......添加';' 在每個 -Properties 參數之間。
".\.nuget\nuget.exe" pack "My.csproj" -Build -IncludeReferencedProjects -Version 02.06.5 -verbosity detailed -suffix UAT -Properties "Configuration=Release;AllowUnsafeBlocks=true"
- 1 回答
- 0 關注
- 118 瀏覽
添加回答
舉報
0/150
提交
取消