我有一个Xamarin - Nancy应用程序,我已经导入了所有必需的库。但是,当我对我的应用程序进行调试时,xamarin的控制台会抛出此错误。
/Library/Frameworks/Mono.framework/Versions/3.2.6/lib/mono/4.0/Microsoft.Common.targets: Error: Command '
if Debug == Debug (
xcopy /s /y /R "/Users/ivan/Projects/sisam/src/packages/Nancy.Viewengines.Razor.0.21.1/BuildProviders/Nancy.ViewEngines.Razor.BuildProviders.dll" "/Users/ivan/Projects/sisam/src/app/Sisam.UI/bin/"
xcopy /s /y /R "/Users/ivan/Projects/sisam/src/packages/Nancy.Viewengines.Razor.0.21.1/lib/Net40/Nancy.ViewEngines.Razor.dll" "/Users/ivan/Projects/sisam/src/app/Sisam.UI/bin/"
)
if Debug == Debug (
xcopy /s /y /R "/Users/ivan/Projects/sisam/src/.nuget/../../../packages/Nancy.Viewengines.Razor.0.22.2/BuildProviders/Nancy.ViewEngines.Razor.BuildProviders.dll" "/Users/ivan/Projects/sisam/src/app/Sisam.UI/bin/"
xcopy /s /y /R "/Users/ivan/Projects/sisam/src/.nuget/../../../packages/Nancy.Viewengines.Razor.0.22.2/lib/Net40/Nancy.ViewEngines.Razor.dll" "/Users/ivan/Projects/sisam/src/app/Sisam.UI/bin/"
)
if Debug == Debug (
xcopy /s /y /R "/Users/ivan/Projects/sisam/src/.nuget/../../packages/Nancy.Viewengines.Razor.0.22.2/BuildProviders/Nancy.ViewEngines.Razor.BuildProviders.dll" "/Users/ivan/Projects/sisam/src/app/Sisam.UI/bin/"
xcopy /s /y /R "/Users/ivan/Projects/sisam/src/.nuget/../../packages/Nancy.Viewengines.Razor.0.22.2/lib/Net40/Nancy.ViewEngines.Razor.dll" "/Users/ivan/Projects/sisam/src/app/Sisam.UI/bin/"
)' exited with code: 2. (Sisam.UI)
我真的不知道发生了什么,我会很感激。感谢。
答案 0 :(得分:0)
xcopy,这就是构建失败的原因。
Nancy.ViewEngine.Razor NuGet包为您的项目添加了一个构建后步骤。此post构建步骤使用xcopy将dll复制到bin文件夹。不幸的是,Mac上没有xcopy。这就是构建失败的原因。
您需要更改后期构建步骤,以使用特定于Mac的命令行来复制文件。所以你需要替换以下内容:
xcopy /s /y /R