Is there a good Valgrind substitute for Windows?

当我发现它仅用于Linux时,我正在考虑Valgrind来帮助改进我的C编码/调试 - 我没有其他需要或有兴趣将我的操作系统迁移到Linux,所以我想知道是否有一个同样适用于Windows的程序。 Some more good commercial tools: Purify Insure++ As jakobengblom2 pointed out, valgrind has a suit of tools. Depending which one you are talking about there are different windows counter parts. I will only mention OSS or fre

是否有良好的Valgrind替代Windows?

当我发现它仅用于Linux时,我正在考虑Valgrind来帮助改进我的C编码/调试 - 我没有其他需要或有兴趣将我的操作系统迁移到Linux,所以我想知道是否有一个同样适用于Windows的程序。 一些更好的商业工具: 净化 保证++ 正如jakobengblom2指出的那样,valgrind有一套工具。 取决于你在谈论哪一个有不同的窗口柜台部分。 我只会在这里提到OSS或免费工具。 1. MemCheck: 记忆博士。 它是一个相对较新的工具,在Windows 7

Memory Leak in C#

Is it ever possible in a managed system to leak memory when you make sure that all handles, things that implement IDispose are disposed? Would there be cases where some variables are left out? Event Handlers are a very common source of non-obvious memory leaks. If you subscribe to an event on object1 from object2, then do object2.Dispose() and pretend it doesn't exist (and drop out all r

内存泄漏在C#中

当你确定所有的句柄,实现IDispose东西都被丢弃时,在托管系统中是否有可能泄漏内存? 会不会有一些变数被忽略的情况? 事件处理程序是非常明显的内存泄漏的常见来源。 如果您从object2订阅object1上的事件,然后执行object2.Dispose()并假装它不存在(并从您的代码中删除所有引用),则object1的事件中存在一个隐式引用,该引用将阻止object2存在垃圾收集。 MyType object2 = new MyType(); // ... object1.SomeEvent +

Could not load file or assembly ... The parameter is incorrect

Recently I met the following exception at C# solution: Error 2 Could not load file or assembly 'Newtonsoft.Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b9a188c8922137c6' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) This does not depend either on my code or on the name of assembly (like Newtonsoft.Json in this c

无法加载文件或程序集...该参数不正确

最近我在C#解决方案遇到以下异常: 错误2无法加载文件或程序集'Newtonsoft.Json,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = b9a188c8922137c6'或其某个依赖项。 该参数不正确。 (来自HRESULT的异常:0x80070057(E_INVALIDARG)) 这不取决于我的代码或程序集的名称(如本例中的Newtonsoft.Json )。 当我从解决方案中删除此dll时,编译器会以相同的异常告诉另一个dll。 所以我想应该关掉/打

Could not load file or assembly or one of its dependencies

I'm having another of these "Could not load file or assembly or one of its dependencies" problems. Additional information: Could not load file or assembly 'Microsoft.Practices.Unity, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exceptio

无法加载文件或程序集或其依赖项之一

我有另一个这样的“无法加载文件或程序集或其依赖关系”的问题。 其他信息:无法加载文件或程序集'Microsoft.Practices.Unity,Version = 1.2.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或其某个依赖项。 定位的程序集清单定义与程序集引用不匹配。 (来自HRESULT的异常:0x80131040) 我不知道是什么导致了这个问题,或者我怎么能够调试它来找到原因。 我在我的解决方案目录.csproj文件以及我

Avoid NullReferenceException when accessing EF Navigation Properties

Many of the bugs I've been fixing lately are a result of null references when accessing navigation properties of objects loaded using entity framework. I believe there must be a flaw in how I'm designing my methods. Here's an example... A Task contains Many Roles, each Role references a User. public class Role { public int Id; public int User_Id; public string Type; }

访问EF导航属性时避免出现NullReferenceException

我最近修复的很多错误都是在访问使用实体框架加载的对象的导航属性时导致的空引用。 我相信我在设计我的方法方面一定存在缺陷。 这是一个例子... 任务包含多个角色,每个角色引用一个用户。 public class Role { public int Id; public int User_Id; public string Type; } public class User { public int Id public string Name; } public class Task { public int Id; public string N

Dynamic Assemblies and Methods

I've programmed .NET and C# for years now, but have only recently encountered the DynamicMethod type along with the concept of a Dynamic Assembly within the context of reflection. They seem to always be used within IL (runtime code) generation. Unfortunately MSDN does an extraordinarily poor job of defining what a dynamic assembly/method actuallty is and also what they should be used for.

动态装配和方法

我已经编写了.NET和C#多年,但最近才在反射的上下文中遇到DynamicMethod类型以及Dynamic Assembly的概念。 它们似乎总是在IL(运行时代码)生成中使用。 不幸的是,MSDN在定义什么是动态组合/方法实现方面做得非常差,而且它们应该用于什么。 请问anyoen能在这里启发我吗? 与DLR有什么关系? 它们与运行时的静态(正常)生成的程序集和方法有什么不同? 我应该知道如何以及何时使用它们? DynamicMethod用于创建没有

C# Absolute URI removes ".." from URL

I have to upload a file via FTP to ftp://ftp.remoteServer.com My root directory on remoteServer contains an "upload" and a "download" folder. I need to put my file in the "upload" directory. But on log in, the server automatically puts me in the "download" folder. I tried doing this: string serverTarget = "ftp://ftp.remoteServer.com/"; serverTarget +

C#绝对URI从URL中删除“..”

我必须通过FTP上传文件到ftp://ftp.remoteServer.com 我在远程服务器上的根目录包含一个“上传”和一个“下载”文件夹。 我需要将我的文件放在“上传”目录中。 但在登录时,服务器会自动将我置于“下载”文件夹中。 我试过这样做: string serverTarget = "ftp://ftp.remoteServer.com/"; serverTarget += "../upload/myfile.txt"; Uri target = new Uri(serverTarget); FTPWebRequest ftp = (FTPWebRequest)FtpWebRequest.Create

System.ComponentModel.Win32Exception: The network path was not found Error

I have created A database inside visual studio and then add the connections string in my code string connString = "Data Source=(LocalDB)v11.0;AttachDbFilename="D:\POS\App_Data\POS.mdf";Integrated Security=True"; I am getting this exception when I try to fetch data from Database [Win32Exception (0x80004005): The network path was not found] [SqlException (0x80131904): A network-related or ins

System.ComponentModel.Win32Exception:未找到网络路径错误

我在Visual Studio中创建了一个数据库,然后在我的代码中添加连接字符串 string connString = "Data Source=(LocalDB)v11.0;AttachDbFilename="D:\POS\App_Data\POS.mdf";Integrated Security=True"; 当我尝试从数据库获取数据时,我收到了这个异常 [Win32Exception(0x80004005):未找到网络路径] [SqlException(0x80131904):建立与SQL Server的连接时发生网络相关或实例特定的错误。 服务器未找到或无法访问。 验

Failure to connect my web page to a database

UPDATE: I missed that I should use using MySql.Data.MySqlClient reference and MySqlConnection since I have been trying to connect a mysql server. Java mislead me I could connect easily with two lines. sorry for taking time** I'm trying to connect my web page to a database. I can connect easily using java in order to generate tables but I cannot connect with C# / Asp. The error on the o

未能将我的网页连接到数据库

更新:我错过了我应该使用MySql.Data.MySqlClient引用和MySqlConnection,因为我一直在尝试连接一个mysql服务器。 Java误导我,我可以轻松地连接两条线。 抱歉花时间** 我试图将我的网页连接到数据库。 为了生成表格,我可以使用java轻松连接,但无法使用C#/ Asp连接。 输出屏幕上的错误是: 在System.Data.dll中发生类型'System.Data.SqlClient.SqlException'的第一次机会异常 码: try { con = new Sq

SqlException: System.Data.SqlClient.SqlException (0x80131904)

I wrote a code in C#, which works great at my computer, with Windows 7 (MS SQL Server 2008) but not at the other with Windows Vista (MS SQL Server 2005). I can not change system on the second computer ;) I'm using Visual Studio 2010. So this is the part of code, from my class "obSQL": private SqlConnection connection; public obSQL(string user, string pass, string instance,

SqlException:System.Data.SqlClient.SqlException(0x80131904)

我用C#编写了一个代码,这个代码在Windows 7(MS SQL Server 2008)中非常适用于我的计算机,但在Windows Vista(MS SQL Server 2005)中则没有。 我无法更改第二台计算机上的系统;)我正在使用Visual Studio 2010。 所以这是来自我的类​​“obSQL”的代码的一部分: private SqlConnection connection; public obSQL(string user, string pass, string instance, string dbdir) //sql server authentication {