.net

Can you use the Phoenix compiler as a more powerful NGEN?

In case you don't know of Phoenix, it's a compiler framework from Microsoft that's apparantly going to be the foundation of all their new compilers. It can read in code from CIL, x86, x64, and IA64; and emit code in x86, x64, IA64, or CIL. Can I use it to transform a pure .Net app into a pure native app? By which I mean, it will not hav...

Serializing DateTime to time without milliseconds and gmt

I have created a C# class file by using a XSD-file as an input. One of my properties look like this: private System.DateTime timeField; [System.Xml.Serialization.XmlElementAttribute(DataType="time")] public System.DateTime Time { get { return this.timeField; } set { this.timeField = value; } } ...

Can Resharper be set to warn if IDisposable not handled correctly?

Is there a setting in Resharper 4 (or even Visual Studio itself...) that forces a warning if I forget to wrap code in a using block, or ommit the proper Dispose call in a finally block? ...

TcpClient.Connected returns true yet client is not connected, what can I use instead?

In VB.net I'm using the TcpClient to retrieve a string of data. I'm constantly checking the .Connected property to verify if the client is connected but even if the client disconnects this still returns true. What can I use as a workaround for this? This is a stripped down version of my current code: Dim client as TcpClient = Nothing...

Merge Modules for Crystal Reports 2008 - Needs a Keycode?

I've not been able to find any information on this, but is a keycode required to be embedded in the CR2008 merge modules for a .NET distribution? They used to require this (which had to be done using ORCA), but I've not found any information on this for CR2008. ...

.Net Assembly Hell

I am Trying to develop a .Net Web Project using NHibernate and Spring.net. But I'm stuck. Spring.net seems to depend on different versions of the NHibernate assemblies (maybe it needs 1.2.1.4000 and my NHibernate version is 1.2.0.4000). I solved some problems with the "bindingRedirect" TAG, but now even that stopped working. My Questi...

What is the preferred practice for event arguments provided by custom events?

In regards to custom events in .NET, what is the preferred design pattern for passing event arguments? Should you have a separate EventArgs derived class for each event that can be raised, or it is acceptable to have a single class for the events if they are all raised by events from the same class? ...

C#.net datagrid

How to add child rows in datagrid c#.net windows forms? ...

Priority queue in .Net

I am looking for a .Net (preferably C#) implementation of a priority queue or heap. Unless I am looking in the wrong place, there isn't one in the framework. Is anyone aware of a good one, or should I roll my own? ...

Viewing, pausing and killing threads in a running .Net application

I'm working on a .Net applications with multiple threads doing all sorts of things. When something goes wrong in production I want to be able to see which threads are running (by their managed name) and also be able to pause / kill them. Anyway to achieve this ? ...

How to shutdown the computer from C#

What's the best way to shutdown the computer from a C# program? I've found a few methods that work - I'll post them below - but none of them are very elegant. I'm looking for something that's simpler and natively .net. ...

Posting forms to a 404 + HttpHandler in IIS7: why has all POST data gone missing?

OK, this might sound a bit confusing and complicated, so bear with me. We've written a framework that allows us to define friendly URLs. If you surf to any arbitrary URL, IIS tries to display a 404 error (or, in some cases, 403;14 or 405). However, IIS is set up so that anything directed to those specific errors is sent to an .aspx file...

C# VB.NET Conversion

Which tools do you use to convert between C# and VB.NET? ...

Where can I see what Color properties in .NET like "BlanchedAlmond" look like?

I'm in the middle of writing code in .Net to draw something in my app and I need to pick a color to use. But what does the color "Chartreuse" look like? Isn't there a nice bitmap that shows what each of the system colors look like somewhere? Thanks! ...

How to convert an XML file into a .Net class?

Can someone please remind me how to create a .Net class from an XML file? I would prefer the batch commands, or a way to integrate it into the shell. Thanks! ...

Where can I find Microsoft assemblies that are not already in Visual Studio?

I figured someone can answer the question generally but if anyone wants to get specific I am trying to use: using System.Web.Security.SingleSignOn; using System.Web.Security.SingleSignOn.Authorization; I've googled my brains out and this is the closest answer I found: "We discussed this offline, but it looks like the ADFS assembly is ...

What is your single favorite feature in ReSharper?

My whole department has owned individual copies of ReSharper for about a year, but I find I'm one of only two people that actually use any of its features regularly. I'm trying to get everybody to use it more effectively and would like opinions on the most useful features and their shortcuts so I can share more than just what I use it f...

Managed C++ Method naming

I'm using managed c++ to implement a method that returns a string. I declare the method in my header file using the following signature: String^ GetWindowText() However, when I'm using this method from C#, the signature is: string GetWindowTextW(); How do I get rid of the extra "W" at the end of the method's name? ...

Simple way to parse a person's name into its component parts?

A lot of contact management programs do this - you type in a name (e.g., "John W. Smith") and it automatically breaks it up internally into: First name: John Middle name: W. Last name: Smith Likewise, it figures out things like "Mrs. Jane W. Smith" and "Dr. John Doe, Jr." correctly as well (assuming you allow for fields like "prefix" a...

What's the best way to determine the name of your machine in a .NET app?

I need to get the name of the machine my .NET app is running on. What is the best way to do this? ...