Mono:在Linux中编译MV5项目

时间:2016-09-27 04:10:54

标签: c# xamarin mono

我们正在尝试使用Mono编译项目,但我们遇到了一些麻烦。我们对Mono来说还很陌生。

我们正在使用Xamarin创建一个csproj文件,然后我们将所有源代码复制到一个Linux框中,然后运行以下命令:

xbuild /path/to/csprojfile.csproj /t:Build /p:OutputPath="/var/pubsite/myproject" /p:Configuration="Release"

项目已成功构建并正确复制到/var/pubsite/myproject。但是,当我们使用fastcgi-mono-server4运行项目时,项目无效。我们有一个

System.ArgumentException
Directory does not exist
Parameter name: value

Description: HTTP 400.Error processing request.

我们认为我们没有成功发布。我们意识到我们能够在旧版本中发布,其中有一个名为/var/pubsite/myproject/_PublishedWebsites的文件夹,但该文件夹不再创建。

  • 我们如何成功构建单声道应用程序?
  • 如果问题是" / var / pubsite / myproject / _PublishedWebsites"没有创建,我们如何调查问题是什么?构建的输出没有显示任何内容。

xbuild输出

XBuild Engine Version 14.0
Mono, Version 4.4.2.0
Copyright (C) 2005-2013 Various Mono authors

Build started 9/27/2016 12:06:24 PM.
__________________________________________________
Project "/var/source/MyProject.Core/Core/API/MyProject.Core.Api/MyProject.Core.Api.csproj" (Build target(s)):
        Target PrepareForBuild:
                Configuration: Release Platform: AnyCPU
                Created directory "/var/pubsite/MyProject.Core.api/"
        Target ResolveProjectReferences:
                Project "/var/source/MyProject.Core/Core/MyProject.Core.Common/MyProject.Core.Common.csproj" (default target(s)):
                        Target PrepareForBuild:
                                Configuration: Release Platform: AnyCPU
                        Target CopyFilesMarkedCopyLocal:
                                Copying file from '/var/source/MyProject.Core/packages/fastJSON.2.1.20/lib/net40/fastjson.dll' to '/var/pubsite/MyProject.Core.api/fastjson.dll'
                        Target GenerateSatelliteAssemblies:
                        No input files were specified for target GenerateSatelliteAssemblies, skipping.
                        Target GenerateTargetFrameworkMonikerAttribute:
                        Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
                        Target CoreCompile:
                        Skipping target "CoreCompile" because its outputs are up-to-date.
                        Target DeployOutputFiles:
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Common/obj/Release/MyProject.Core.Common.dll.mdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Common.dll.mdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Common/obj/Release/MyProject.Core.Common.pdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Common.pdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Common/obj/Release/MyProject.Core.Common.dll' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Common.dll'
                Done building project "/var/source/MyProject.Core/Core/MyProject.Core.Common/MyProject.Core.Common.csproj".
                Project "/var/source/MyProject.Core/Core/MyProject.Core.Domain/MyProject.Core.Domain.csproj" (default target(s)):
                        Target PrepareForBuild:
                                Configuration: Release Platform: AnyCPU
                        Target ResolveAssemblyReferences:
/usr/lib/mono/4.5/Microsoft.Common.targets:  warning : Reference 'Newtonsoft.Json' not resolved
                                For searchpath {CandidateAssemblyFiles}
                                Warning: {CandidateAssemblyFiles} not supported currently
                                For searchpath {HintPathFromItem}
                                Considered ../../packages/Newtonsoft.Json.6.0.4/lib/net45/Newtonsoft.Json.dll, but it does not exist.
                                For searchpath {TargetFrameworkDirectory}
                                Considered target framework dir /usr/lib/mono/4.5-api, assembly named 'Newtonsoft.Json' not found.
                                Considered target framework dir /usr/lib/mono/4.5-api/Facades/, assembly named 'Newtonsoft.Json' not found.
                                For searchpath {PkgConfig}
                                Considered Newtonsoft.Json, but could not find in any pkg-config files.
                                For searchpath {GAC}
                                Considered Newtonsoft.Json, but could not find in the GAC.
                                For searchpath {RawFileName}
                                Considered 'Newtonsoft.Json' as a file, but the file does not exist
                                For searchpath /var/pubsite/MyProject.Core.api/
                                Considered '/var/pubsite/MyProject.Core.api/Newtonsoft.Json' as a file, but the file does not exist
                                Considered '/var/pubsite/MyProject.Core.api/Newtonsoft.Json.exe' as a file, but the file does not exist
                                Considered '/var/pubsite/MyProject.Core.api/Newtonsoft.Json.dll' as a file, but the file does not exist
                        Target CopyFilesMarkedCopyLocal:
                                Copying file from '/var/source/MyProject.Core/packages/PetaPoco.Core.Compiled.5.1.228/lib/net45/PetaPoco.dll' to '/var/pubsite/MyProject.Core.api/PetaPoco.dll'
                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.OrmLite/V45/ServiceStack.Interfaces.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.Interfaces.dll'
                        Target GenerateSatelliteAssemblies:
                        No input files were specified for target GenerateSatelliteAssemblies, skipping.
                        Target GenerateTargetFrameworkMonikerAttribute:
                        Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
                        Target CoreCompile:
                        Skipping target "CoreCompile" because its outputs are up-to-date.
                        Target DeployOutputFiles:
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Domain/obj/Release/MyProject.Core.Domain.dll.mdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Domain.dll.mdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Domain/obj/Release/MyProject.Core.Domain.pdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Domain.pdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Domain/obj/Release/MyProject.Core.Domain.dll' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Domain.dll'
                Done building project "/var/source/MyProject.Core/Core/MyProject.Core.Domain/MyProject.Core.Domain.csproj".
                Project "/var/source/MyProject.Core/Core/MyProject.Core.Service/MyProject.Core.Service.csproj" (default target(s)):
                        Target PrepareForBuild:
                                Configuration: Release Platform: AnyCPU
                        Target ResolveProjectReferences:
                                Project "/var/source/MyProject.Core/Core/MyProject.Core.Data/MyProject.Core.Data.csproj" (default target(s)):
                                        Target PrepareForBuild:
                                                Configuration: Release Platform: AnyCPU
                                        Target CopyFilesMarkedCopyLocal:
                                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.OrmLite/V45/ServiceStack.Common.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.Common.dll'
                                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.OrmLite/V45/ServiceStack.OrmLite.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.OrmLite.dll'
                                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.OrmLite/V45/ServiceStack.OrmLite.PostgreSQL.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.OrmLite.PostgreSQL.dll'
                                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.OrmLite/V45/ServiceStack.Text.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.Text.dll'
                                                Copying file from '/var/source/MyProject.Core/packages/Npgsql.3.1.7/lib/net45/Npgsql.dll' to '/var/pubsite/MyProject.Core.api/Npgsql.dll'
                                        Target GenerateSatelliteAssemblies:
                                        No input files were specified for target GenerateSatelliteAssemblies, skipping.
                                        Target GenerateTargetFrameworkMonikerAttribute:
                                        Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
                                        Target CoreCompile:
                                        Skipping target "CoreCompile" because its outputs are up-to-date.
                                        Target _CopyAppConfigFile:
                                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Data/app.config' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Data.dll.config'
                                        Target DeployOutputFiles:
                                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Data/obj/Release/MyProject.Core.Data.dll.mdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Data.dll.mdb'
                                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Data/obj/Release/MyProject.Core.Data.pdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Data.pdb'
                                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Data/obj/Release/MyProject.Core.Data.dll' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Data.dll'
                                Done building project "/var/source/MyProject.Core/Core/MyProject.Core.Data/MyProject.Core.Data.csproj".
                        Target ResolveAssemblyReferences:
/usr/lib/mono/4.5/Microsoft.Common.targets:  warning : Reference 'Newtonsoft.Json' not resolved
                                For searchpath {CandidateAssemblyFiles}
                                Warning: {CandidateAssemblyFiles} not supported currently
                                For searchpath {HintPathFromItem}
                                Considered ../../packages/Newtonsoft.Json.6.0.4/lib/net45/Newtonsoft.Json.dll, but it does not exist.
                                For searchpath {TargetFrameworkDirectory}
                                Considered target framework dir /usr/lib/mono/4.5-api, assembly named 'Newtonsoft.Json' not found.
                                Considered target framework dir /usr/lib/mono/4.5-api/Facades/, assembly named 'Newtonsoft.Json' not found.
                                For searchpath {PkgConfig}
                                Considered Newtonsoft.Json, but could not find in any pkg-config files.
                                For searchpath {GAC}
                                Considered Newtonsoft.Json, but could not find in the GAC.
                                For searchpath {RawFileName}
                                Considered 'Newtonsoft.Json' as a file, but the file does not exist
                                For searchpath /var/pubsite/MyProject.Core.api/
                                Considered '/var/pubsite/MyProject.Core.api/Newtonsoft.Json' as a file, but the file does not exist
                                Considered '/var/pubsite/MyProject.Core.api/Newtonsoft.Json.exe' as a file, but the file does not exist
                                Considered '/var/pubsite/MyProject.Core.api/Newtonsoft.Json.dll' as a file, but the file does not exist
                        Target CopyFilesMarkedCopyLocal:
                                Copying file from '/var/source/MyProject.Core/packages/fastJSON.2.1.18/lib/net40/fastjson.dll' to '/var/pubsite/MyProject.Core.api/fastjson.dll'
                        Target GenerateSatelliteAssemblies:
                        No input files were specified for target GenerateSatelliteAssemblies, skipping.
                        Target GenerateTargetFrameworkMonikerAttribute:
                        Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
                        Target CoreCompile:
                        Skipping target "CoreCompile" because its outputs are up-to-date.
                        Target DeployOutputFiles:
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Service/obj/Release/MyProject.Core.Service.dll.mdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Service.dll.mdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Service/obj/Release/MyProject.Core.Service.pdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Service.pdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Service/obj/Release/MyProject.Core.Service.dll' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Service.dll'
                Done building project "/var/source/MyProject.Core/Core/MyProject.Core.Service/MyProject.Core.Service.csproj".
                Project "/var/source/MyProject.Core/Core/MyProject.Core.Ioc/MyProject.Core.Ioc.csproj" (default target(s)):
                        Target PrepareForBuild:
                                Configuration: Release Platform: AnyCPU
                        Target CopyFilesMarkedCopyLocal:
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.Web.Infrastructure.1.0.0.0/lib/net40/Microsoft.Web.Infrastructure.dll' to '/var/pubsite/MyProject.Core.api/Microsoft.Web.Infrastructure.dll'
                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.Interfaces.4.0.62/lib/portable-wp80+sl5+net40+win8+wpa81+monotouch+monoandroid+xamarin.ios10/ServiceStack.Interfaces.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.Interfaces.dll'
                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.Text.4.0.62/lib/net40/ServiceStack.Text.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.Text.dll'
                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.Common.4.0.62/lib/net40/ServiceStack.Common.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.Common.dll'
                                Copying file from '/var/source/MyProject.Core/packages/ServiceStack.OrmLite.4.0.62/lib/net45/ServiceStack.OrmLite.dll' to '/var/pubsite/MyProject.Core.api/ServiceStack.OrmLite.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Newtonsoft.Json.9.0.1/lib/net45/Newtonsoft.Json.dll' to '/var/pubsite/MyProject.Core.api/Newtonsoft.Json.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebApi.Client.5.2.3/lib/net45/System.Net.Http.Formatting.dll' to '/var/pubsite/MyProject.Core.api/System.Net.Http.Formatting.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebApi.Core.5.2.3/lib/net45/System.Web.Http.dll' to '/var/pubsite/MyProject.Core.api/System.Web.Http.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebApi.WebHost.5.2.3/lib/net45/System.Web.Http.WebHost.dll' to '/var/pubsite/MyProject.Core.api/System.Web.Http.WebHost.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.Razor.3.2.3/lib/net45/System.Web.Razor.dll' to '/var/pubsite/MyProject.Core.api/System.Web.Razor.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.Helpers.dll' to '/var/pubsite/MyProject.Core.api/System.Web.Helpers.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.Deployment.dll' to '/var/pubsite/MyProject.Core.api/System.Web.WebPages.Deployment.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.dll' to '/var/pubsite/MyProject.Core.api/System.Web.WebPages.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.Razor.dll' to '/var/pubsite/MyProject.Core.api/System.Web.WebPages.Razor.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Microsoft.AspNet.Mvc.5.2.3/lib/net45/System.Web.Mvc.dll' to '/var/pubsite/MyProject.Core.api/System.Web.Mvc.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Autofac.3.5.2/lib/net40/Autofac.dll' to '/var/pubsite/MyProject.Core.api/Autofac.dll'
                                Copying file from '/var/source/MyProject.Core/packages/Autofac.WebApi2.4.0.0/lib/net45/Autofac.Integration.WebApi.dll' to '/var/pubsite/MyProject.Core.api/Autofac.Integration.WebApi.dll'
                        Target GenerateSatelliteAssemblies:
                        No input files were specified for target GenerateSatelliteAssemblies, skipping.
                        Target GenerateTargetFrameworkMonikerAttribute:
                        Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
                        Target CoreCompile:
                        Skipping target "CoreCompile" because its outputs are up-to-date.
                        Target _CopyAppConfigFile:
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Ioc/app.config' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Ioc.dll.config'
                        Target DeployOutputFiles:
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Ioc/obj/Release/MyProject.Core.Ioc.dll.mdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Ioc.dll.mdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Ioc/obj/Release/MyProject.Core.Ioc.pdb' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Ioc.pdb'
                                Copying file from '/var/source/MyProject.Core/Core/MyProject.Core.Ioc/obj/Release/MyProject.Core.Ioc.dll' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Ioc.dll'
                Done building project "/var/source/MyProject.Core/Core/MyProject.Core.Ioc/MyProject.Core.Ioc.csproj".
        Target CopyFilesMarkedCopyLocal:
                Copying file from '/var/source/MyProject.Core/packages/Newtonsoft.Json.6.0.8/lib/net45/Newtonsoft.Json.dll' to '/var/pubsite/MyProject.Core.api/Newtonsoft.Json.dll'
                Copying file from '/var/source/MyProject.Core/packages/fastJSON.2.1.20/lib/net40/fastjson.dll' to '/var/pubsite/MyProject.Core.api/fastjson.dll'
        Target GenerateSatelliteAssemblies:
        No input files were specified for target GenerateSatelliteAssemblies, skipping.
        Target GenerateTargetFrameworkMonikerAttribute:
        Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
        Target CoreCompile:
        Skipping target "CoreCompile" because its outputs are up-to-date.
        Target DeployOutputFiles:
                Copying file from '/var/source/MyProject.Core/Core/API/MyProject.Core.Api/obj/Release/MyProject.Core.Api.dll' to '/var/pubsite/MyProject.Core.api/MyProject.Core.Api.dll'
Done building project "/var/source/MyProject.Core/Core/API/MyProject.Core.Api/MyProject.Core.Api.csproj".

Build succeeded.

Warnings:

/var/source/MyProject.Core/Core/API/MyProject.Core.Api/MyProject.Core.Api.csproj (Build) ->
/usr/lib/mono/4.5/Microsoft.Common.targets (ResolveProjectReferences target) ->
/var/source/MyProject.Core/Core/MyProject.Core.Domain/MyProject.Core.Domain.csproj (default targets) ->
/usr/lib/mono/4.5/Microsoft.Common.targets (ResolveAssemblyReferences target) ->

        /usr/lib/mono/4.5/Microsoft.Common.targets:  warning : Reference 'Newtonsoft.Json' not resolved

/var/source/MyProject.Core/Core/API/MyProject.Core.Api/MyProject.Core.Api.csproj (Build) ->
/usr/lib/mono/4.5/Microsoft.Common.targets (ResolveProjectReferences target) ->
/var/source/MyProject.Core/Core/MyProject.Core.Service/MyProject.Core.Service.csproj (default targets) ->
/usr/lib/mono/4.5/Microsoft.Common.targets (ResolveAssemblyReferences target) ->

        /usr/lib/mono/4.5/Microsoft.Common.targets:  warning : Reference 'Newtonsoft.Json' not resolved

         2 Warning(s)
         0 Error(s)

0 个答案:

没有答案