本文整理汇总了C#中NuGet.OptimizedZipPackage.GetFullName方法的典型用法代码示例。如果您正苦于以下问题:C# OptimizedZipPackage.GetFullName方法的具体用法?C# OptimizedZipPackage.GetFullName怎么用?C# OptimizedZipPackage.GetFullName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NuGet.OptimizedZipPackage
的用法示例。
在下文中一共展示了OptimizedZipPackage.GetFullName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: push_package
public static void push_package(ChocolateyConfiguration config, string nupkgFilePath)
{
var timeout = TimeSpan.FromSeconds(Math.Abs(config.PushCommand.TimeoutInSeconds));
if (timeout.Seconds <= 0)
{
timeout = TimeSpan.FromMinutes(5); // Default to 5 minutes
}
const bool disableBuffering = false;
var packageServer = new PackageServer(config.Sources, ApplicationParameters.UserAgent);
packageServer.SendingRequest += (sender, e) => { if (config.Verbose) "chocolatey".Log().Info(ChocolateyLoggers.Verbose, "{0} {1}".format_with(e.Request.Method, e.Request.RequestUri)); };
var package = new OptimizedZipPackage(nupkgFilePath);
try
{
packageServer.PushPackage(
config.PushCommand.Key,
package,
new FileInfo(nupkgFilePath).Length,
Convert.ToInt32(timeout.TotalMilliseconds),
disableBuffering);
}
catch (InvalidOperationException ex)
{
var message = ex.Message;
if (!string.IsNullOrWhiteSpace(message) && message.Contains("(500) Internal Server Error"))
{
throw new ApplicationException("There was an internal server error, which might mean the package already exists on a Simple OData Server.", ex);
}
throw;
}
"chocolatey".Log().Info(ChocolateyLoggers.Important, () => "{0} was pushed successfully to {1}".format_with(package.GetFullName(), config.Sources));
}