在Resharper中,如果你按住Ctrl键单击一个类的名称导航到它的定义并且有一个设计者fie,Resharper会询问我是否要转到X.cs或X.Designer.cs,因为该类是部分的.
有谁知道如何禁用这种烦恼,以便它只是去X.cs并忽略设计师文件?
我有一个应用程序,使用.exe文件所在目录下的本地版本的ODAC 11.我们的想法是,我们希望我们的应用程序使用本地ODAC 11,无论用户在她的计算机上安装了什么.
Oracle.DataAccess.dll与.exe位于同一目录中.
当客户端计算机没有安装Oracle客户端时,它可以正常工作,但在安装了Oracle Database 10.2.0.something的计算机上启动它时出错:
The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.
[Stack Trace]
The provider is not compatible with the version of Oracle client
OracleException
at Oracle.DataAccess.Client.OracleInit.Initialize()
at Oracle.DataAccess.Client.OracleConnection..cctor()
Run Code Online (Sandbox Code Playgroud)
我猜这与运行时绑定策略有关,但在Google上搜索"Oracle/ODAC/ODP.NET运行时绑定策略"并没有发现任何有用的东西.
有谁知道如何解决这个问题?
如果不是这个特定的问题,有人可以指出我如何做我想做的概述:确保我的应用程序使用ODAC 11无论如何?
我在我编写的C#库中有一些类型,例如:
namespace SprocGenerator.Generators
{
public class DeleteGenerator : GeneratorBase
{
public DeleteGenerator(string databaseName, string tableName) : base(databaseName, tableName)
Run Code Online (Sandbox Code Playgroud)
我想在IronPython脚本中使用它们:
import clr
import sys
clr.AddReferenceToFile("SprocGenerator.dll")
# problem happens here:
from SprocGenerator.Generators import *
generator = DeleteGenerator("a", "b")
Run Code Online (Sandbox Code Playgroud)
当评论下面的行发生时,我得到:
ImportError: No module named Generators
Run Code Online (Sandbox Code Playgroud)
我已经验证了我正在加载的文件是我期望的重命名它并且在尝试加载程序集时验证脚本会引发错误.我已通过Reflector验证了命名空间在程序集中.我还尝试指定一个完全限定的类名来解决我的导入问题,例如
generator = SprocGenerator.Generators.DeleteGenerator("a", "b")
Run Code Online (Sandbox Code Playgroud)
但我得到:
NameError: name 'SprocGenerator' is not defined
Run Code Online (Sandbox Code Playgroud)
即使我在C#中有这个:
namespace SprocGenerator
{
public static class GeneratorHelper
{
public static string GetTableAlias(string tableName)
Run Code Online (Sandbox Code Playgroud)
这在IP中:
import clr
import sys
from System import *
clr.AddReferenceToFile("SprocGenerator.dll")
from SprocGenerator …Run Code Online (Sandbox Code Playgroud) 有没有办法让 Resharper 4.5 理解多行 TODO 或 NOTE?
例如,这将在 TODO 资源管理器中显示为两个项目:
// NOTE: Because of the external dependency, this method is particularly bug-prone.
// NOTE: Once we've adopted automated testing, we could get some nice testing for this stuff using a repository to mock an actual account.
Run Code Online (Sandbox Code Playgroud)
有没有办法让它显示为单个项目而不用写在一个很长的行上?
在我正在开发的项目中,我们将自动生成的DTO映射到业务对象.该数据库有一个啊哈不寻常的(但基本一致)的命名约定,这意味着它可能最DTO属性名称转换为等效的业务对象属性的名称,这样就节省了很多行代码.
例如,在DTO(和数据库)中,我们有一个名为的属性account_ID__created,它将映射到一个名为的BO属性CreatedAccountId.这是发生的一种转变MemberNameTransformer.GetBoMemberName(),因此它不像使用不同分隔符的略微不同的约定那么简单.
按照我在AutoMapper源代码中提供的内容,我将此作为我的最佳猜测:
public class DtoBoMappingOptions : IMappingOptions
{
public INamingConvention SourceMemberNamingConvention
{
get { return new PascalCaseNamingConvention(); }
set { throw new NotImplementedException(); }
}
public INamingConvention DestinationMemberNamingConvention
{
get { return new PascalCaseNamingConvention(); }
set { throw new NotImplementedException(); }
}
public Func<string, string> SourceMemberNameTransformer
{
get { return s => s; }
set { throw new NotImplementedException(); }
}
public Func<string, string> DestinationMemberNameTransformer
{
get { return MemberNameTransformer.GetBoMemberName; } …Run Code Online (Sandbox Code Playgroud) 我有一个聚合根'Order',它有许多方法在其内部设置其'Status'字段:
可用的操作取决于订单的当前状态(例如,如果它已经处于暂停状态,则不能将其置于保持状态).问题是我需要提供一个查询来告诉UI哪些命令是可用的,这样我就可以隐藏原本会抛出的操作InvalidOperationException.
如何以最小的DRY违规执行此操作?
当我序列化ASP.NET MVC表单时,我得到了这个:
{
DestinationId: "e96dd00a-b042-41f7-bd59-f369904737b6",
...
}
Run Code Online (Sandbox Code Playgroud)
但是我想要这个,所以它与JS编码约定一致:
{
destinationId: "e96dd00a-b042-41f7-bd59-f369904737b6",
...
}
Run Code Online (Sandbox Code Playgroud)
如何将对象和小写字体作为每个属性的第一个字符?
当我在RestSharp中发出请求时:
var response = client.Execute<bool>(request);
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
"Unable to cast object of type 'System.Boolean' to type 'System.Collections.Generic.IDictionary`2[System.String,System.Object]'."
Run Code Online (Sandbox Code Playgroud)
这是完整的HTTP响应,每个Fiddler:
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 01 Apr 2013 15:09:14 GMT
Content-Length: 5
false
Run Code Online (Sandbox Code Playgroud)
似乎一切都是响应的犹太人,那么是什么给出了?
此外,如果我通过返回一个简单的值而不是一个对象来对我的WebAPI控制器做一些愚蠢的事情并且这将解决我的问题,请随时提出建议.
在NServiceBus中处理异常的当前建议是使用内置工具.错误的消息将转到错误消息队列,并将日志写入磁盘.
但是,如果我想将我的错误发送到像AirBrake这样的服务,该服务具有更好的功能来分组类似的异常,指标和其他好东西呢?我可以使用全局异常处理程序吗?
c# ×2
amazon-ec2 ×1
automapper ×1
cloud-init ×1
cqrs ×1
ec2-ami ×1
ironpython ×1
javascript ×1
nservicebus ×1
odp.net ×1
oracle ×1
resharper ×1
restsharp ×1