小编Dra*_*ake的帖子

Thread.SpinWait方法的目的是什么?

来自MSDN的目的并不是很明确.

它可以用来模拟密集的CPU计算测试吗?

.net multithreading

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

最好的WPF开源项目

我用WPF编程了一年多.当我开始时,没有那么多的例子和指导可供遵循,现在情况要好得多.

我想请教您一些帮助,列出您建议学习的最佳WPF(开放)源代码示例或项目,以便更多地了解项目结构,最佳实践等.

谢谢你,马可

.net wpf open-source

58
推荐指数
3
解决办法
6万
查看次数

为什么Tuple的项目是ReadOnly?

我想用Tupleclass来存储我程序中需要的2个整数信息(StartAddress,EndAddress).

但我发现Tuple项是ReadOnly,所以如果我需要为一个项设置一个值,我需要重新实例化一个元组.

这个设计决定背后的原因是什么?

.net tuples .net-4.0 readonly

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

我需要安装什么来使用Visual Studio 2013编译Platform Toolset v100?

我刚刚格式化了PC并安装了Visual Studio 2013.现在,我想编译Visual Studio 2010 C++解决方案而不转换它并继续定位v100平台工具集.

我收到这个错误:

error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...".  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets   64  5   TPC30004
Run Code Online (Sandbox Code Playgroud)

和项目属性我看到我当然错过了所需的工具集.

Platform Toolset设置为Visual Studio 2010(v100)的项目属性(未安装)

我无法更改目标,因为无法强制XP用户安装新的C++ 2013可重新分发,所以可能我应该安装Visual Studio 2010来解决问题,但如果可能的话我想避免它(目前小SSD和没有多少自由空间).

还有其他选择吗?

c++ visual-studio-2013

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

后台和并发垃圾收集之间的区别?

我在.NET Framework 4中读到了当前的垃圾收集实现:

.NET Framework 4提供后台垃圾回收.此功能取代了以前版本中的并发垃圾回收,并提供了更好的性能.

这个页面上有一个解释它如何工作,但我不确定我理解它.

在实际的世界应用中,这种新GC实施的好处是什么?它是否可用于推动从3.5或之前的过渡到4.0?

garbage-collection .net-4.0

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

是否可以存储自动Team Foundation Server登录的凭据?

是否可以直接在Visual Studio 2010中存储用于连接到Team Foundation Server凭据

我想避免在每次VS发布时插入它们.

问题是托管TFS的计算机不在域中,我使用在该计算机上创建的用户的凭据进行连接.

假设机器名称为TOOLS且用户为Marco,我需要每次都插入

 User name: TOOLS\Marco 
 Password: *
Run Code Online (Sandbox Code Playgroud)

如果它存在,你能建议一个可能的解决方案吗?

tfs credentials visual-studio-2010 visual-studio

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

如何使用MSBuild定位v110平台工具集?

我正在开发一个命令行应用程序,它创建一个完整的Visual Studio 11解决方案,由单个VC++项目组成,并尝试使用MSBuild最终编译它.

我面临的问题很奇怪.

如果我在Visual Studio 11中执行我的命令行程序,它的工作原理; 如果我在开发环境之外启动它,它会抛出错误:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(511,5): error MSB8008: Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected. [f:\ABC.vcxproj]
Run Code Online (Sandbox Code Playgroud)

我正在使用的命令如下:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe f:\snake\W9A30040.vcxproj /property:PlatformToolset=v110;Configuration=Debug /v:quiet
Run Code Online (Sandbox Code Playgroud)

但我觉得PlatformToolset = v110被忽略,MSBuild使用v100(Visual Studio 2010).

您对如何告诉MSBuild编译v110 Platform Toolset有什么建议吗?

msbuild visual-c++ visual-studio-2012

20
推荐指数
3
解决办法
4万
查看次数

为什么FontStretch在WPF中不起作用?

我正在尝试在WPF中的TextBlock上设置FontStretch属性,但似乎它不起作用.我尝试过Expanded,Condensed等,但文字外观没有变化.

我正在使用带有Framework 4.0的Windows XP,并使用Verdana和Arial进行了测试.

它仅适用于Windows 7或仅适用于某些特定字体吗?

编辑:如果它不适用于所有字体,是否有支持此功能的字体列表?或者是否可以修改像Verdana/Arial这样的字体来支持它?

.net wpf fonts stretch

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

如何摆脱恼人的Horizo​​ntalContentAlignment绑定警告?

我正在研究一个大型的WPF项目,在调试期间,我的输出窗口充满了这些烦人的警告:

System.Windows.Data信息:10:无法使用绑定检索值,并且不存在有效>回退值; 使用默认值. BindingExpression:路径= Horizo​​ntalContentAlignment; 的DataItem = NULL; target元素是' ComboBoxItem '(Name =''); target属性是'Horizo​​ntalContentAlignment'(类型>'Horizo​​ntalAlignment')

在具体示例中,ComboBoxItem以这种方式设置样式:

<Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
    <Setter Property="OverridesDefaultStyle" Value="True"/>
    <Setter Property="SnapsToDevicePixels" Value="True"/>                  
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                <Border 
                    Name="bd"
                    Padding="4,4,4,4"
                    SnapsToDevicePixels="True" 
                    CornerRadius="2,2,2,2">
                    <ContentPresenter />
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsHighlighted" Value="true">
                        <Setter TargetName="bd" Property="Background"  Value="{StaticResource MediumBrush}"/>
                        <Setter TargetName="bd" Property="Padding"  Value="4,4,4,4"/>
                        <Setter TargetName="bd" Property="CornerRadius"  Value="2,2,2,2"/>
                    </Trigger>
                </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
Run Code Online (Sandbox Code Playgroud)

我知道问题是由ComboBoxItem的默认主题定义生成的,其中包含以下内容:

<Setter Property="Control.HorizontalContentAlignment">
        <Setter.Value>
            <Binding Path="HorizontalContentAlignment" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ItemsControl, AncestorLevel=1}" />
            </Setter.Value>
        </Setter>
Run Code Online (Sandbox Code Playgroud)

但我也认为使用

<Setter Property="OverridesDefaultStyle" …
Run Code Online (Sandbox Code Playgroud)

.net wpf xaml binding

15
推荐指数
2
解决办法
5667
查看次数

使用Visual Studio 2010和VB.NET进行调试:由于保护级别,立即失败

使用Visual Studio 2010,在调试期间,当我使用立即命令时,它经常发生,每天更多次,如:

?命名变量

我收到以下错误:

'NamedVariable'未声明.由于其保护级别,它可能无法访问.

在这种情况下,其他调试功能似乎也没有了,但我可以设置断点,步入,跳过等.

解决方案是停止调试,清理并重建项目,然后重试.

我正在开发一个VB.NET Windows窗体应用程序,但它也发生在VB.NET WPF项目中.我从未在VS 2008中遇到过这种行为.

这是一个已知的错误还是可能是我的环境/安装问题?你有任何想法如何解决这个小问题但烦人的问题?

vb.net debugging visual-studio-2010

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