简体   繁体   English

使用nuget pack获取具有一些不安全代码的解决方案时出错

[英]Getting error when using nuget pack for a solution with some unsafe code

I am currently trying to pack a nuget package for solution with some unsafe code. 我目前正在尝试使用一些不安全的代码打包一个nuget软件包。 It's running fine with MSBuild because I am able to give it the following parameter: /p:AllowUnsafeBlocks=true MSBuild运行正常,因为我可以给它以下参数: /p:AllowUnsafeBlocks=true

I have tried several way to give the same parameter to my nuget.exe pack command. 我已经尝试了几种方法来为我的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"

I am getting the following error: 我收到以下错误:

error CS0227: Unsafe code may only appear if compiling with /unsafe

EDIT: It's also running fine from VS becase the solution is well setup :) 编辑:它也运行良好的VS因为解决方案很好设置:)

the solution is really simple.... Add ';' 解决方案非常简单....添加';' between each -Properties parameters. 每个-Properties参数之间。

".\.nuget\nuget.exe" pack "My.csproj" -Build -IncludeReferencedProjects -Version 02.06.5 -verbosity detailed -suffix UAT -Properties "Configuration=Release;AllowUnsafeBlocks=true"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM