小编c0D*_*g1c的帖子

VS 2012商店创建应用程序包已禁用

我想创建应用程序包为我的Windows Store应用,但创建应用程序软件包的菜单项将被禁用.我找到了这篇文章:

http://msdn.microsoft.com/en-us/library/windows/apps/hh454036.aspx

其中声明某些菜单项在某些条件下将被禁用,但它没有描述这些条件是什么.

有谁知道这些条件是什么,因为我似乎无法找到更多关于此的信息.

visual-studio microsoft-metro windows-store-apps

4
推荐指数
1
解决办法
3422
查看次数

TeamCity自定义内部版本号 - AssemblyInfo修补程序

我创建了一个适合我需求的TeamCity构建配置,请参阅下面的构建日志:

构建日志

除了1件事 - Custom Build Number之外,它一切都很好用.我的内部版本号格式如下:

  • Major.Minor.BuildCounter.TodaysDate,即2.0.59.20160224.
  • 我用PowerShell脚本实现了这一点.

请注意,在构建日志中,步骤1设置构建号.问题是在更新程序集版本步骤之后会发生这种情况.因此,此版本号不会应用于我的程序集.

但是正确的版本号在构建过程中的其他任何位置都使用.

所以我的问题是,如何在AssemblyInfo Patcher运行之前设置自定义内部版本号?

powershell teamcity build-process

4
推荐指数
1
解决办法
893
查看次数

.NET WPF窗口FadeIn和FadeOut动画

下面是窗口FadeIn和FadeOut动画的代码片段:

// Create the fade in storyboard
fadeInStoryboard = new Storyboard();
fadeInStoryboard.Completed += new EventHandler(fadeInStoryboard_Completed);
DoubleAnimation fadeInAnimation = new DoubleAnimation(0.0, 1.0, new Duration(TimeSpan.FromSeconds(0.30)));
Storyboard.SetTarget(fadeInAnimation, this);
Storyboard.SetTargetProperty(fadeInAnimation, new PropertyPath(UIElement.OpacityProperty));
fadeInStoryboard.Children.Add(fadeInAnimation);

// Create the fade out storyboard
fadeOutStoryboard = new Storyboard();
fadeOutStoryboard.Completed += new EventHandler(fadeOutStoryboard_Completed);
DoubleAnimation fadeOutAnimation = new DoubleAnimation(1.0, 0.0, new Duration(TimeSpan.FromSeconds(0.30)));
Storyboard.SetTarget(fadeOutAnimation, this);
Storyboard.SetTargetProperty(fadeOutAnimation, new PropertyPath(UIElement.OpacityProperty));
fadeOutStoryboard.Children.Add(fadeOutAnimation);
Run Code Online (Sandbox Code Playgroud)

以下是触发动画的辅助方法:

/// <summary>
/// Fades the window in.
/// </summary>
public void FadeIn()
{
   // Begin fade in animation
   this.Dispatcher.BeginInvoke(new Action(fadeInStoryboard.Begin), DispatcherPriority.Render, null); …
Run Code Online (Sandbox Code Playgroud)

.net wpf animation window

3
推荐指数
1
解决办法
5351
查看次数

c#.net 4.5异步等待Task.Wait()阻塞问题

我有以下扩展方法:

internal static string ReadLine(this DataReader stream)
{
   Task<string> line = ReadLineAsync(stream);
   // line.Wait(); - Not Required, as next call blocks
   return line.Result;
}
Run Code Online (Sandbox Code Playgroud)

它基本上是一个异步方法调用的同步方法调用包装器,它返回一个字符串.如果我逐行遍历它,代码工作正常,但似乎如果我让它自由执行,我会遇到一个无限期的块.有任何想法吗?

与上一个问题相关,我发布了:如何更新我的API以使用async关键字而不使用等待所有调用者

.net c# deadlock async-await .net-4.5

3
推荐指数
1
解决办法
7317
查看次数

.NET HttpClient - 远程主机强行关闭现有连接

我从 ASP.NET MVC 控制器调用了这段代码:

protected string PostData(string url, ByteArrayContent content)
        {
            using (var client = new HttpClient())
            {
                client.Timeout = TimeSpan.FromDays(1);
                return client.PostAsync(url, content).Result.Content.ReadAsStringAsync().Result;
            }
        }
Run Code Online (Sandbox Code Playgroud)

如果我将数据发布到需要一些时间来执行的 REST 服务,我会收到此错误:

System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc dotnet-httpclient

2
推荐指数
1
解决办法
1万
查看次数

构建本机c ++以用作.net库

我有c ++的功能源代码,对我很有吸引力.

为了从.net应用程序引用它或者将此代码构建为.net程序集(最好是c#),需要付出/需要付出什么样的努力/工作?

这是我第一次尝试移植代码,所以请一步一步地为我分解你的答案.

c# c++ build code-conversion

1
推荐指数
1
解决办法
387
查看次数

匹配仅由单个正斜杠分隔的文本

我正在尝试使用Regex.Split以下方法拆分类似于此的字符串:

要返回这个:

实际上,忽略双正斜杠而只担心单个正斜杠。

我知道我应该使用类似这种/(?!/)负面展望的东西- 但无法让它发挥作用。

这不是这个Similar Question的副本,因为如果您通过 Regex.Split 运行该正则表达式,它不会给出所需的结果。

.net c# regex

1
推荐指数
1
解决办法
1243
查看次数

遍历和打印复杂列表

方法签名:

public static string TraverseList(string prefix, object list)
Run Code Online (Sandbox Code Playgroud)

输入:

prefix: "Boo"
list: new object[] { "a string", new[] { "a", "b", "c" }, "spam", new[] { "eggs" }, new[] { new[] { "one", "two" }, new[] { "three", "four" } } }
Run Code Online (Sandbox Code Playgroud)

预期产出:

Boo.0: a string
Boo.1.0: a
Boo.1.1: b
Boo.1.2: c
Boo.2: spam
Boo.3.0: eggs
Boo.4.0.0: one
Boo.4.0.1: two
Boo.4.1.0: three
Boo.4.1.1: four
Run Code Online (Sandbox Code Playgroud)

我试图实现这个:

public static string TraverseList(string prefix, object list)
{
    int index = 0;
    int index1 = …
Run Code Online (Sandbox Code Playgroud)

.net c#

-6
推荐指数
2
解决办法
420
查看次数