小编pal*_*rse的帖子

切换到WPF应用程序的设计视图时,Visual Studio 2008 SP1崩溃的原因

在开发没有Source Control的WPF应用程序之后,我决定将解决方案添加到TFS.

每当我打开设计视图中的主窗口.xaml文件时,Visual Studio将会消失,并在应用程序事件日志中记录以下事件:

.NET运行时版本2.0.50727.3053 - 致命执行引擎错误(7A035E00)(80131506)

有关详细信息,请参阅http://go.microsoft.com/fwlink/events.asp上的"帮助和支持中心" .

wpf powercommands visual-studio-2008

18
推荐指数
3
解决办法
9609
查看次数

在CruiseControl.NET中使用MSTest

我们在NUnit和NAnt上使用CruiseControl已有一段时间了.对于最近的项目,我们决定使用Visual Studio附带的测试框架,到目前为止已经足够了.

我正在尝试在CruiseControl中运行解决方案.我终于让构建本身工作了; 但是,尽管添加了自定义构建任务和旨在实现此目的的组件,但我无法在CruiseControl界面中显示任何测试.有没有人有明确的链接,有关于设置这些设置的说明?

cruisecontrol.net msbuild build-process

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

在尝试选择节点时如何在xsl中使用变量?

我原本以为这对谷歌来说很容易,但我一直没有成功.

我想从属性中分配一个变量值(目前为止很容易),然后使用该变量根据该属性的值选择另一个节点.

例:

<xsl:variable name="myId" select="@id" />
<xsl value-of select="//Root/Some/Other/Path/Where[@id='{@myId}']/@Name />
Run Code Online (Sandbox Code Playgroud)

这不起作用.如果我用变量中的值替换{@myId},那么它确实找到了正确的节点,但是这样做就不会产生任何结果.我确定我错过了一些东西,或者也许有不同的方法可以做到这一点.

上下文是在不同的顶级节点下存在共享相同id值的相关数据,因此我需要在模板中获取相关节点.

xslt

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

你如何解决WPF UI问题?

我正在开发一个WPF应用程序,它有时会出现奇怪的问题并且似乎在UI中.它是不一致的,它发生在不同的页面中,但它经常发生,这是一个大问题.我应该提一下,这不是真正的挂起,如下所述.

我的第一个想法是,一些按钮的动画是问题,因为它们在大多数页面上使用,但在删除它们之后仍然会出现挂起,尽管看起来有点不常见.当挂起发生时我试图闯入调试器; 但是从来没有任何代码可供查看.我的代码没有运行.我也注意到"挂起"并不完整.我有代码可以让我拖动表单(它没有边框或标题)继续工作.我也有我赢得的关闭按钮,当我点击它时功能.当我的代码运行时,单击按钮似乎实际工作,但UI根本不会更新以显示新页面.

我正在寻找任何建议,工具或技术来追踪这个奇怪的问题,所以如果你有任何想法,我将非常感激.

编辑:它刚刚再次发生,所以这次当我试图闯入调试器时,我选择"显示反汇编".它带我到MS.Win32.UnsafeNativeMethods.GetMessageW.堆栈跟踪如下:

[Managed to Native Transition]  
Run Code Online (Sandbox Code Playgroud)

WindowsBase.dll!MS.Win32.UnsafeNativeMethods.GetMessageW(ref System.Windows.Interop.MSG msg,System.Runtime.InteropServices.HandleRef hWnd,int uMsgFilterMin,int uMsgFilterMax)+ 0x15 bytes
WindowsBase.dll!System.Windows.Threading. Dispatcher.GetMessage(ref System.Windows.Interop.MSG msg,System.IntPtr hwnd,int minMessage,int maxMessage)+ 0x48 bytes WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame = {System.Windows.Threading.DispatcherFrame})+ 0x8b bytes WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame)+ 0x49 bytes
WindowsBase.dll!System.Windows.Threading. Dispatcher.Run()+ 0x4c字节
PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore)+ 0x1e bytes
PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window)+ 0x6f bytes PresentationFramework.dll!System.Windows.Application.运行(System.Windows.Window窗口)+ 0x26字节PresentationFramework.dll!System.Windows.Application.Run()+ 0x19字节WinterGreen.exe!WinterGreen.App.Main()+ 0x5e字节C#[本机到托管转换]
[管理原生过渡]
mscorlib.dll!System.AppDomain.nExecuteAssembly(System.Reflection.Assembly assembly,string [] args)+ 0x19 bytes mscorlib.dll!System.Runtime.Hosting.ManifestRunner.Run(bool checkAptModel)+ 0x6e bytes mscorlib.dll!System .Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()+ 0x84 bytes mscorlib.dll!System.Runtime.Hosting.ApplicationActivator.CreateInstance(System.ActivationContext activationContext,string [] activationCustomData)+ 0x65 bytes mscorlib.dll!System.Runtime.Hosting. ApplicationActivator.CreateInstance(System.ActivationContext activationContext)+ 0xa bytes mscorlib.dll!System.Activator.CreateInstance(System.ActivationContext …

debugging wpf user-interface xaml

10
推荐指数
2
解决办法
5597
查看次数

Visual Studio 2008保存文件变慢

我已经找了一些关于这个问题的其他文章,甚至在这个帖子中尝试了一些想法; 然而,还没有解决这个问题.所以,关于这个问题.

在Visual Studio(通常是C#)中工作时会发生一些事情,导致IDE在保存文件时变得有点不稳定.我会一直工作一段时间,然后在某些时候我注意到每次我保存文件(Ctrl + S)它变得非常慢.

我注意到的行为是这样的; 我以某种方式点击保存(Ctrl + S,菜单等等),在状态栏中我看到搜索字样显示.看起来它正在扫描所有已加载的命名空间,但我不知道它是为什么或为什么这样做.它会导致工作流程出现真正的打嗝,因为通常我会经常按Ctrl + S并继续输入.

我一直无法追查究竟是什么导致这种情况开始发生.它发生在多种项目类型(Web,WPF,控制台)中.

有没有人看到这种行为或有任何建议?

visual-studio-2008

5
推荐指数
2
解决办法
4412
查看次数

将2个WPF ComboBoxes数据绑定到1个源,而无需“链接”

我有一个主从场景,其中有1个来自ObjectDataSourceProvider的ComboBox上市公司。在此之下,我有2个ComboBoxes绑定到当前Company对象的Contacts属性。我需要能够在每个组合框中选择其他联系人;但是,一旦我在一个列表中更改选择,其他列表就会更新为同一联系人。

我尝试了不同的设置(OneWay与TwoWay),但到目前为止似乎没有任何效果。这是我的XAML的摘录。

<Page.Resources>
    <!-- This is a custom class inheriting from ObjectDataProvider -->
    <wg:CustomersDataProvider x:Key="CompanyDataList" />
</Page.Resources>

<Grid>
    <!--- other layout XAML removed -->
    <ComboBox x:Name="Customer" Width="150"
              ItemsSource="{Binding Source={StaticResource CompanyDataList},Path=Companies,Mode=OneWay}"
              DisplayMemberPath="Name"
              SelectedValuePath="Id"
              IsSynchronizedWithCurrentItem="True"
              SelectedValue="{Binding Path=Id, Mode=OneWay}" 
              VerticalAlignment="Bottom" />

    <ComboBox x:Name="PrimaryContact" Width="150"
              DataContext="{Binding ElementName=Customer,Path=Items,Mode=OneWay}"
              ItemsSource="{Binding Path=Contacts,Mode=OneWay}"
              DisplayMemberPath="FullName"
              SelectedValuePath="Id"
              IsSynchronizedWithCurrentItem="True"
              SelectedValue="{Binding Path=Id,Mode=OneWay}" />

    <ComboBox x:Name="AdminContact" Width="150"
              DataContext="{Binding ElementName=OwnerCustomer,Path=Items,Mode=OneWay}"
              ItemsSource="{Binding Path=Contacts,Mode=OneWay}"
              DisplayMemberPath="FullName"
              SelectedValuePath="Id"
              IsSynchronizedWithCurrentItem="True"
              SelectedValue="{Binding Path=Id,Mode=OneWay}" />

    <!--- other layout XAML removed -->
</Grid>
Run Code Online (Sandbox Code Playgroud)

我以为创建CollectionViewSource是可行的方法,但我无法做到这一点。有没有简单的方法可以做到这一点,从而使PrimaryContact和AdminContact不链接?

data-binding wpf xaml

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

ListBox中的所有组合框都会在更改其中任何一个时更改

我有一个ListBox绑定到ObservableCollection自定义类型的表单.在每个项目中都有ComboBox一个枚举类型的绑定.当窗口加载时,所有ComboBoxes都默认为某个值.当我更改SelectedItem任何一个(从UI,而不是从代码),所有其他ComboBox更改为相同SelectedItem.

我不确定我做错了什么,这是我目前处理这个问题的XAML.

<Window.Resources>
    <ObjectDataProvider x:Key="SyncOperationValues"
                        MethodName="GetNames"
                        ObjectType="{x:Type sys:Enum}">
        <ObjectDataProvider.MethodParameters>
            <x:Type TypeName="local:SyncOperationEnum" />
        </ObjectDataProvider.MethodParameters>
    </ObjectDataProvider>
...
    <DataTemplate x:Key="SyncListTemplate">
        <Grid Grid.Column="1" Grid.RowSpan="2" Margin="0,0,20,0" x:Name="olDetails"
            DataContext="{Binding Path=OlContact}">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
            <RowDefinition />
            </Grid.RowDefinitions>
...
            <ComboBox x:Name="SyncOp" 
                Width="120" Height="19"
                Margin="4,0,10,0" 
                IsSynchronizedWithCurrentItem="True" 
                ItemsSource="{Binding Source={StaticResource SyncOperationValues}}"
                             SelectedItem="{Binding Operation}"
                             VerticalAlignment="Center" />

...
Run Code Online (Sandbox Code Playgroud)

ListBox:

 <ListBox x:Name="SyncList"
     ScrollViewer.HorizontalScrollBarVisibility="Hidden"
     ItemContainerStyle="{StaticResource StretchedContainerStyle}"
     ItemTemplate="{StaticResource SyncListTemplate}">
 ListBox> …
Run Code Online (Sandbox Code Playgroud)

data-binding wpf combobox listbox

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