Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法从源本地生成xamarin forms 5.0.*_C#_Xamarin_Xamarin.forms_Nuget - Fatal编程技术网

C# 无法从源本地生成xamarin forms 5.0.*

C# 无法从源本地生成xamarin forms 5.0.*,c#,xamarin,xamarin.forms,nuget,C#,Xamarin,Xamarin.forms,Nuget,由于一些定制的原因,我们在XF中有一些定制的内置功能(比如基于XAML的工具栏按钮,将私有内部更改为公共类,以及虚拟化一些方法)。因此,我们依赖于XF NuGet包的自定义版本 在XF5.0版本之前,它(几乎总是)工作得很好。我有一个带有Windows的专用虚拟机,并为此预装了VS 当我试图使用下一个命令从源代码构建XF时 \build.ps1-Target numgetpack-ScriptArgs'-packageVersion=“5.0.0.2013” 我得到一个错误: Successfu

由于一些定制的原因,我们在XF中有一些定制的内置功能(比如基于XAML的工具栏按钮,将私有内部更改为公共类,以及虚拟化一些方法)。因此,我们依赖于XF NuGet包的自定义版本

在XF5.0版本之前,它(几乎总是)工作得很好。我有一个带有Windows的专用虚拟机,并为此预装了VS

当我试图使用下一个命令从源代码构建XF时
\build.ps1-Target numgetpack-ScriptArgs'-packageVersion=“5.0.0.2013”
我得到一个错误:

Successfully created package 'L:\src_github\xf_patch_release-5.0.0-sr3.1\artifacts\Xamarin.Forms.Maps.WPF.5.0.0.2013.nupkg'.
NuGet Version: 5.9.1.11
Attempting to build package from 'Xamarin.Forms.temp.nuspec'.
Object reference is not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at NuGet.Packaging.PackageBuilder.<>c.<ValidateReferenceAssemblies>b__173_1(NuGet.Frameworks1204671.NuGetFramework groupFramework)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
   at System.Collections.Generic.HashSet`1..ctor(IEnumerable`1 collection, IEqualityComparer`1 comparer)
   at NuGet.Packaging.PackageBuilder.ValidateReferenceAssemblies(IEnumerable`1 files, IEnumerable`1 packageAssemblyReferences)
   at NuGet.Packaging.PackageBuilder.Save(Stream stream)
   at NuGet.Commands.PackCommandRunner.BuildPackage(PackageBuilder builder, String outputPath, Boolean symbolsPackage)
   at NuGet.Commands.PackCommandRunner.BuildFromNuspec(String path)
   at NuGet.CommandLine.PackCommand.ExecuteCommand()
   at NuGet.CommandLine.Command.ExecuteCommandAsync()
   at NuGet.CommandLine.Command.Execute()
   at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
An error occurred when executing task '_NuGetPack'.
Error: One or more errors occurred. (NuGet: Process returned an error (exit code 1).)
        NuGet: Process returned an error (exit code 1).
成功创建了包“L:\src\u github\xf\u patch\u release-5.0.0-sr3.1\artifacts\Xamarin.Forms.Maps.WPF.5.0.0.2013.nupkg”。
NuGet版本:5.9.1.11
正在尝试从“Xamarin.Forms.temp.nuspec”生成包。
对象引用未设置为对象的实例。
System.NullReferenceException:对象引用未设置为对象的实例。
在NuGet.Packaging.PackageBuilder.c.b_173_1(NuGet.framework1204671.nugetframeworkgroupframework)
在System.Linq.Enumerable.WhereSelectEnumerableInterator`2.MoveNext()中
at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1其他)
位于System.Collections.Generic.HashSet`1..ctor(IEnumerable`1集合,IEqualityComparer`1比较器)
在NuGet.Packaging.PackageBuilder.ValidateReferenceAssemblies(IEnumerable`1文件,IEnumerable`1 packageAssemblyReferences)
在NuGet.Packaging.PackageBuilder.Save(流)
在NuGet.Commands.PackCommandRunner.BuildPackage(PackageBuilder、String outputPath、Boolean SymbolPackage)
在NuGet.Commands.PackCommandRunner.BuildFromNuspec(字符串路径)处
在NuGet.CommandLine.PackCommand.ExecuteCommand()处
在NuGet.CommandLine.Command.ExecuteCommandAsync()处
在NuGet.CommandLine.Command.Execute()处
位于NuGet.CommandLine.Program.MainCore(字符串工作目录,字符串[]args)
执行任务“\u NuGetPack”时出错。
错误:发生了一个或多个错误。(NuGet:进程返回错误(退出代码1)。)
NuGet:进程返回错误(退出代码1)。
我试图用不同的方法来解决这个不可理解的问题,但什么也没发生。我尝试使用最新的实际
release-5.0.0-sr3.1
标签和分支
5.0.0
我试图更改
build.cake
文件中的一些设置,以便从解决方案中卸载一些项目(例如与UWP相关的项目,这通常会导致很多错误)。我试着在我的工作计算机(和环境)上构建解决方案——我得到了同样的结果。 然后我转而直接在VS中构建解决方案,并开始遇到如下问题:

在调用要生成的主任务之前:
\build.ps1-Target numgetpack…
我总是调用
\build.ps1-Target provision
,以确保我没有错过每个Windows操作系统上所需的一些工具


有什么我遗漏的吗?

我发现我使用的是另一个版本的NuGet package manager,我必须在我的操作系统上全局安装它。正确的版本可以在XF的管道中找到(,请参阅与Windows相关的版本)。 在我将全局版本更改为5.6.0之后,构建脚本开始正确地为Xamarin.Forms项目本身生成*.nupkg文件