小编siv*_*a.k的帖子

XAML语法错误阻止设计器但编译正常

我遇到了一个相当离奇的事情,我DataGrid在WPF XMAL页面中定义了以下声明:

<DataGrid.Resources>
    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF3399FF" />
    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="White" />
    <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="#FF3399FF"/>
    <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="White" />
</DataGrid.Resources>
Run Code Online (Sandbox Code Playgroud)

从技术上讲,这两种Inactive SystemColors类型来自.net 4.5,但是当我将它设置为目标.net 4时,我可以编译该程序,并且这些非活动画笔可以工作,但是当它设置为目标.net 4时,在Visual Studio中加载XMAL设计器页面会引发错误The member "InactiveSelectionHighlightTextBrushKey" is not recognized or is not accessible.然后阻止设计器视图.但它仍然按照程序中的定义进行编译和显示.

至少可以说这看起来非常不一致,我无法判断这是否是Visual Studio 2012问题,或者它是否允许程序编译,因为我的开发计算机已经安装了.net 4.5而且只是在它看到时才更改目标框架有些东西正在使用它(我非常怀疑这一点).或者,非活动类型是否可能在.net 4中,但未在文档中列出,并且仅在VS中导致此问题?

有没有更好的方法在.net 4中执行此操作以允许我设置DataGrid行的非活动选择颜色?或者是升级到.net 4.5的唯一方法吗?

.net wpf xaml datagrid visual-studio-2012

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

NuGet包管理器控制台无法加载PowerShell

执行从Windows 7 Pro到8 Pro的就地升级后,我无法让NuGet的包管理器控制台在Visual Studio 2012 Pro中运行.我收到的错误是:

The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2977) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2984) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error …
Run Code Online (Sandbox Code Playgroud)

powershell visual-studio nuget

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

在Azure表存储中的DateTime字段上进行筛选时出现异常

尝试通过DateTime字段过滤Azure表存储的结果时,我遇到了一种奇怪的问题.对于具有两个不同模型的两个不同表,我有两个不同的查询.两者都需要在DateTime字段上进行过滤,但只有一个工作,另一个返回异常:

Microsoft.WindowsAzure.Storage.StorageException was unhandled by user code
HResult=-2146233088
Message=The remote server returned an error: (400) Bad Request.
Source=Microsoft.WindowsAzure.Storage
StackTrace:
    at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
Run Code Online (Sandbox Code Playgroud)

查询:

 var fromDate = DateTime.UtcNow.AddDays(-14);
Run Code Online (Sandbox Code Playgroud)

工作一:

 from entity in AnalyticsStorage.ConversionTable.CreateQuery<ConversionAnalyticsModel>()
 where entity.Date > fromDate
 select entity
Run Code Online (Sandbox Code Playgroud)

不工作:

 from entity in AnalyticsStorage.Table.CreateQuery<AnalyticsTableModel>()
 where entity.ResponseTime > fromDate
 select entity
Run Code Online (Sandbox Code Playgroud)

我确保在表格中实际填充了DateTime字段.注释掉where会使查询运行,但显然这不是很有用.

有没有人碰到这个?Azure Table Storage中是否存在可能遇到但无法看到的问题?

这是针对当前版本的Azure存储DLL(3.0.3)构建的,并且两个查询在同一个类中并排,只是在不同的方法中.

c# azure azure-table-storage

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