你是如何使用你曾经使用的C#项目中的Exception.Data属性的?
我想要一些建议模式的答案,而不是那些非常适合您的应用的模式.
我很想知道是否已经将任何常用算法(排序,搜索,图形等)移植到OpenCL(或任何GPU语言),以及性能如何与CPU执行的相同算法进行比较.我对结果(数字)特别感兴趣.
谢谢!
我在finally块中有一些关键逻辑(带有空的try块),因为我想保证即使线程被中止也会执行代码.但是,我还想检测ThreadAbortException.我发现在try/catch中包装我的关键try/finally块不会捕获ThreadAbortException.有没有办法检测它?
try { try { } finally { // critical logic } } catch(Exception ex) { // ThreadAbortException is not caught here, but exceptions thrown // from within the critical logic are }
我有一个具有以下基本架构的应用程序:
一种Windows服务(服务),用于注册.NET类型(RemoteObject)以进行远程访问(.NET Remoting).RemoteObject创建使用ThreadPool进行IO处理的非ThreadPool线程.由于特定原因,必须将ThreadPool的大小限制为限制.GUI应用程序使用.NET Remoting来访问RemoteObject.
我注意到如果ThreadPool的大小太小,GUI应用程序将在调用RemoteObject时挂起.
我的问题是,我怎么能弄清楚为什么会挂起,为什么RemoteObject线程会受到ThreadPool的影响?
这真让我抓狂; 谢谢您的帮助!
为什么MS C#编译器在以下场景中抱怨"并非所有代码路径都返回值"?
public int Foo(bool flag)
{
if(flag)
{
return 1;
}
else
{
ThrowException(); // this method always throws an exception
// return -1; // why do I need to add this code that will never be called?
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢!
给定 DFS 路径,如何以编程方式确定它映射到哪个物理文件服务器?
是否有自动重试有意义的SQL Server存储过程错误的简明列表?显然,重试"登录失败"错误没有意义,但重试"超时"确实如此.我认为指定哪些错误重试可能比指定哪些错误不重试更容易.
那么,除了"超时"错误之外,还有哪些其他错误适合自动重试?
谢谢!
.net ×4
c# ×4
ado.net ×1
algorithm ×1
exception ×1
microsoft-distributed-file-system ×1
opencl ×1
reflection ×1
remoting ×1
sql-server ×1