.net

Write Resource file for .net project using the command line

I need to create a resource file for a .net project (by hand) and compile it using the ResGen.exe tool provided by the .NET framework. I can't find any documentation for this. I need to write the resource file by hand because I'm in a situation where I don't want to download/buy extra tools (like VS) to generate this resource file, and a...

Windows log generator

Is there a way to generate specific Windows events? I'm currently developing a solution to get this events through WMI process, but I need all the logs Windows can generate. I know there is a way to make .net solution to write the events to the event viewer, but I don't want that. Is there a way to code or make a solution to make W...

inspect field on all instances in memory dump

I have a memory dump that I'm using to troubleshoot a client issue. This is a .NET (C#) application. The problem with my application is that too many instances of a particular class are being created. There are 6300 instances of this class when there should be something like 20. I want to loop through all of those instances and call ...

Net framework 3.5. Takes too long to run application

Hello. I am developing an application in NET 3.5 C# and WPF and from the beginning it took AGES to run at most machines.. Only on my core i7 machine runs within 2-3 seconds... At most pcs tested it takes about 30 seconds to load!!! even from the start when it contained only a button and no code just to load the application... Can i do so...

Synchrony on web service and browser calls

I have a HttpHandler which queries 3 web services within a single request and store the results in a single cookie. As you would imagine, the results collide. Here is how: Process is as follows: when i query service 1 and waiting for the result, the cookie i m storing the results doesnt exist yet, then result comes from service 2 and v...

Confused by Boxing. Casting -1 to Int64 throws InvalidCastException

Ok I must be overlooking something extremely simple but I am lost. Given this object val = -1; var foo = (Int32)(val); var bar = (Int64)(val); The cast to Int64 throws and InvalidCastException. I recognize this is related to some strangeness with boxing but I don't understand the reasoning. From what I understand val is boxed as ...

Does .Net / C#'s speed degrade with increased field depth?

Is there any execution speed difference between the following two lines of code? I cannot tell from looking at the IL: int x = MainObject.Field1; int x = MainObject.Public.Fields.Field1; I know from Delphi (native code), there is no difference. ...

iParameterInspector array manipulation of inputs OR accessing members of an object in an array of Objects

I have an array of objects (with just one element) which is sent to a function (IParameterInspector - but that is not important) , the element is an object with a string and an int. In the function (inspector) i need to access the actual string and integer. How would i do this? so : private object test(string operationName, object[] in...

What is a good enterprise wide logging + notification solution?

(Microsoft environment) I've been asked to look into replacing our current logging solution : MS Enterprise Library, with something else. We are trying to find something that is not just a "logging" solution, rather we would like to find something that would let us monitor the status of many processes taking place, not just capturing...

Best architecture practice for multiple clients using one web service

I have a web service and multiple clients that will use it. A MVC 2.0 website, a winforms app, and potentially mobile apps. I understand that in the case of the mobile apps, each application will need to access and manage the web service connection internally. But what do I do about the .net applications? I am using composite types fo...

How do you show a tooltip for a DataGridComboBoxColumn?

I want to show a tool tip for the element style (the non-editing mode) of a DataGridComboBoxColumn. I have not been able to figure out a good way of doing this. In the example below I can either show a tooltip, or allow edits to the cell by changing the IsHitTestVisible property to true or false. I have been unable to both show the to...

C#.NET connection string cannot connect

I'm using Visual C# Express 2008 and created a database and dataset by going to Add->New Data Source. I'm trying to add a record to it but cannot connect using the data string provided in the wizard. Please help. Here is my code System.Data.SqlClient.SqlConnection sqlConnection1 = new System.Data.SqlClient.SqlConnection("Data Source=|Da...

.NET send mail complete .NET 2.0 runtime failure (no exception thrown HELP)

Hi All Using the .NET mail api. I have tried using sendmail and sendasync and I am getting a complete application fail. The ASP.NET 2 runtime is failing NOTE I am not getting any exceptions the application pool/Website completely dies HELP!!! The system error log has 2 entries related to it I think and these are the w3p process ...

What's the dumpbin equivalent to mono?

The windows utility of dumpbin can be used for digging into binary files for .NET exe/dll assemblies, as is explained in this site. dumpbin /clrheader lib.dll Dump of file lib.dll File Type: DLL clr Header: 48 cb 2.00 runtime version 210C [ 374] RVA [size] of MetaData Directory 9 flags 0 entry point token 0 [ ...

How to get original sender of a forwarded email with Outlook interop?

I'm developing an add in for Outlook 2010 and I need to be able to retrieve the sender's email address for a MailItem or the email address of the original sender if it is a a forwarded email. Is there any easy way to do that second one besides parsing through the body of the email? ...

Good teaching example for demonstrating debugging techniques?

I'm going to be giving a presentation a little later to a student ACM chapter about how they can utilize debugging tools to solve problems in their code. Any ideas for a (preferably short) bit of example code I can use to demo breakpoints, variable inspection, etc.? My main worry is that I don't want to patronize them by using "Hello Wo...

How do I pass a variable using window.open()?

I would like to add some variables when my window.open function fires. Example: <a href="javascript:void(window.open('Details.aspx', 'Title'))"><%# Eval("Id").ToString) %></a> I would like to pass the id number to the Details.aspx page. How do I do that? ...

Can an XBAP only take up part of the browser screen?

I know with Silverlight you can control the width and height of the Silverlight section within the web page. However, it seems like from what I can tell when you are using XBAP you give the entire browser page area over to WPF. Is there a way to have an HTML and have XBAP be embedded within a rectangle of that HTML page? Or is this on...

Event does not hook up correctly

Hi Folks Not sure if i will be able to formulate my question quite clear but let me try: So i've written a small piece of code which will give the user the option to select a desired status for his Office Communicator when his PC get locked ( by default it goes automatically on status "away" ) .So here it is the Windows Form wich is b...

Efficient way to clone a HashSet<T> ?

A few days ago, I answered an interesting question on SO about HashSet<T>. A possible solution involved cloning the hashset, and in my answer I suggested to do something like this: HashSet<int> original = ... HashSet<int> clone = new HashSet<int>(original); Although this approach is quite straightforward, I suspect it's very inefficie...