.net

Is the order of objects returned by FOREACH stable?

Is it safe to assume that two itterations over the same collection will return the objects in the same order? Obviously, it is assumed that the collection has not otherwise been changed. ...

How to open a form in a thread and force it to stay open

I am still having problems with figuring out how to create winforms in a separate UI thread that I discussed here. In trying to figure this out I wrote the following simple test program. I simply want it to open a form on a separate thread named "UI thread" and keep the thread running as long as the form is open while allowing the user...

Best Microsoft Certification study resource

What is the best resource for studying for Microsoft certifications -- specifically the .NET 2.0 developer series? There are a lot of options out there, we have been using the MS Press books and Transcender exams where I work, but I know there are other competitors -- I would like to see what the StackOverflow community considers the be...

Loading Assemblies into separate AppDomain, getting InvalidCastException

I'm trying to load assemblies in a separate app domain, but am running into a very strange problem. Here's some code: public static void LoadAssembly(string assemblyPath) { string pathToDll = Assembly.GetCallingAssembly().CodeBase; AppDomainSetup domainSetup = new AppDomainSetup { PrivateBinP...

How can I set up a configuation file for .NET console applications?

Is it possible to use a ".net configuration" file for a .NET console application? I'm looking for an equivalent to web.config, but specifically for console applications... I can certainly roll my own, but If I can use .NET's built in configuration reader then I would like to do that...I really just need to store a connection string......

Most Wanted Features for Visual Basic 10.0

In the vein of Most Wanted Feature for C# 4.0, what would you like to see in the next version of VB.NET? ...

Is F# suitable for Physics applications?

I hate Physics, but I love software development. When I go back to school after Thanksgiving, I'll be taking two more quarters of Physics before I'm done with the horrid thing. I am currently reading postings on the F# units of measurement feature, but I've never used a language like F#. Would it be suitable to write applications so I ca...

How would you compare two XML Documents?

As part of the base class for some extensive unit testing, I am writing a helper function which recursively compares the nodes of one XmlDocument object to another in C# (.NET). Some requirements of this: The first document is the source, e.g. what I want the XML document to look like. Thus the second is the one I want to find differ...

SQL Server Service Broker Issue & Tutorials

I've been looking into implementing an external activator in SQL Server Express 2005, and I added the queues, services, contracts, and event notifications to the database. I also added a trigger to send a message to the target queue. Everything parses, runs, and the trigger is firing. However, when I select from the target queue, or use ...

Do .net applications run on Linux ?

Do .net applications run on linux? Are there any free/paid interop libraries available ? ...

Templated delegates

I have the following piece of code pattern: void M1(string s, string v) { try { // Do some work } catch(Exception ex) { // Encapsulate and rethrow exception } } The only difference is that the return type and the number and types of parameters to the methods can vary. I want to create a generic / templated method ...

Capturing method state using Reflection

Is there a way to use .NET reflection to capture the values of all parameters/local variables? ...

Win32_LogicalDisk fails for floppies.

Using an idea from Bob King idea I wrote the following method. It works great on CD's, removable drives, regular drives. However for a floppy it always return "Not Available". Any ideas? public static void TestFloppy( char driveLetter ) { using( var searcher = new ManagementObjectSearcher( @"SELECT * FROM Win32_LogicalDisk WHERE ...

Handling Managed Delegates in Unmanaged code

I know I can get this to technically work but I'd like to implement the cleanest possible solution. Here's the situation: I have a managed library which wraps an unmanaged C-style library. The C-style library functionality I'm currently wrapping does some processing involving a list of strings. The library's client code can provide a...

How can I display a tooltip over a button using Winforms?

How can I display a tooltip over a button using Winforms? ...

What are the best steps to start programming with TDD with C#?

I want to start working with TDD but I don't know really where to start. We coding with .NET (C#/ASP.NET). ...

How to write acceptance tests

Hi, How would you go about introducing acceptance tests into a team using the .NET framework? What tools are available for this purpose? Thanks! ...

What are some string encapsulation classes which specify both meaning and behavior for their contents?

.NET has System.Uri for Uris and System.IO.FileInfo for file paths. I am looking for classes which are traditionally object oriented in that they specify both meaning and behavior for the string which is used in the object's construction. What other useful string encapsulation classes exist? Things such as regular expressions and String...

C# - How can I add SqlParameters without knowing the name / type ?

I am creating a DB wrapper and am in the need of adding SQL paramters to my stament however I do not know the parameter names or type, how can this be done? I have seen many other libraries do this... I just want the order of values to be mapped to the stored procedure...I thought the following code would work: public DataTable Execu...

Howto: Count the items from a IEnumerable<T> without iterating?

private IEnumerable<string> Tables { get { yield return "Foo"; yield return "Bar"; } } Let's say I want iterate on those and write something like processing #n of #m. Is there a way I can find out the value of m without iterating before my main iteration? I hope I made myself clear. ...