VSTS NuGet step restore error: You cannot call a method on a null-valued expression at CallSite.Target(Closure , CallSite , Object , Object )
VSTS NuGet step restore error: You cannot call a method on a null-valued expression at CallSite.Target(Closure , CallSite , Object , Object )
我在 Visual Studio 团队服务(Visual Studio 在线)中执行 NuGet 恢复步骤时出错。我没有设置任何特别的东西,但出现了错误。错误是:
2016-04-10T16:53:36.3476846Z ##[debug]Adding credentials section to NuGet.config
2016-04-10T16:53:36.5691737Z ##[error]System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
2016-04-10T16:53:36.5701787Z ##[error] at CallSite.Target(Closure , CallSite , Object , Object )
2016-04-10T16:53:36.5711737Z ##[error] at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
2016-04-10T16:53:36.5721738Z ##[error] at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
2016-04-10T16:53:36.5721738Z ##[error] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
这里是所有的细节。在几个屏幕截图的开头:
Configuration Bild Step in VSO
Logs from output console in VSO
我的主要 nuget 配置文件如下所示:
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\Aleksandra.Tests\packages.config" />
<repository path="..\Aleksandra\packages.config" />
</repositories>
下一个子配置如下所示:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr" version="3.4.1.9004" targetFramework="net45" />
<package id="bootstrap" version="3.0.0" targetFramework="net45" />
<package id="EntityFramework" version="6.1.3" targetFramework="net45" />
<package id="jQuery" version="1.10.2" targetFramework="net45" />
<package id="jQuery.Validation" version="1.11.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="2.2.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.Owin" version="2.2.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Facebook" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Google" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.MicrosoftAccount" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Twitter" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Modernizr" version="2.6.2" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
<package id="Respond" version="1.2.0" targetFramework="net45" />
<package id="WebGrease" version="1.5.2" targetFramework="net45" />
</packages>
…和..
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="2.2.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
</packages>
查看有关包恢复的 this 文章。引用要点, repositores.config
文件将在需要时自动重新生成。 packages
文件夹通常也是如此。您可以安全地将它们从源代码管理中删除。
此外,您可以将 NuGet.config 的路径文本框留空。除非您有特殊需要(例如,您需要身份验证的私人提要),否则您不需要该文件,所有 packages.config
文件都将在解决方案中提取。
我在 Visual Studio 团队服务(Visual Studio 在线)中执行 NuGet 恢复步骤时出错。我没有设置任何特别的东西,但出现了错误。错误是:
2016-04-10T16:53:36.3476846Z ##[debug]Adding credentials section to NuGet.config
2016-04-10T16:53:36.5691737Z ##[error]System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
2016-04-10T16:53:36.5701787Z ##[error] at CallSite.Target(Closure , CallSite , Object , Object )
2016-04-10T16:53:36.5711737Z ##[error] at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
2016-04-10T16:53:36.5721738Z ##[error] at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
2016-04-10T16:53:36.5721738Z ##[error] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
这里是所有的细节。在几个屏幕截图的开头:
Configuration Bild Step in VSO
Logs from output console in VSO
我的主要 nuget 配置文件如下所示:
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\Aleksandra.Tests\packages.config" />
<repository path="..\Aleksandra\packages.config" />
</repositories>
下一个子配置如下所示:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr" version="3.4.1.9004" targetFramework="net45" />
<package id="bootstrap" version="3.0.0" targetFramework="net45" />
<package id="EntityFramework" version="6.1.3" targetFramework="net45" />
<package id="jQuery" version="1.10.2" targetFramework="net45" />
<package id="jQuery.Validation" version="1.11.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="2.2.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.Owin" version="2.2.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Facebook" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Google" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.MicrosoftAccount" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Twitter" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Modernizr" version="2.6.2" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
<package id="Respond" version="1.2.0" targetFramework="net45" />
<package id="WebGrease" version="1.5.2" targetFramework="net45" />
</packages>
…和..
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.1.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="2.2.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
</packages>
查看有关包恢复的 this 文章。引用要点, repositores.config
文件将在需要时自动重新生成。 packages
文件夹通常也是如此。您可以安全地将它们从源代码管理中删除。
此外,您可以将 NuGet.config 的路径文本框留空。除非您有特殊需要(例如,您需要身份验证的私人提要),否则您不需要该文件,所有 packages.config
文件都将在解决方案中提取。