.net

What are the most relevant OSS projects for .NET?

Not a popularity contest, but if you were to elect some in some categories, what would be the names? Here are a few suggested categories. The only criteria I’d insist on would be: needs to be fully OSS, not a one-man show, have some people involved, have source available and with a well-know open source license (hopefully with no dist...

If I grab a paramenter out of the query string, is it URL decoded?

In .NET if I do something like: string temp = Request.QueryString["myKey"]; is the value in temp already URL decoded? ...

How do I uninstall the .NET framework?

I'm having a problem running a VS 2005 app on some machines and not others. I looked up the error message on google and found a post by someone who had the same error and fixed it by uninstalling and reinstalling the .NET framework. When I try to do that, Windows won't let me because it is in use. Am I expected to uninstall everything...

Map an object reference with HashTable

I'd like to map a reference to an object instead of the object value with an HashTable configMapping.Add("HEADERS_PATH", Me.headers_path) that way when I'm going to retrieve the value of "HEADERS_PATH" I'll be able to assign a value to Me.headers_path something like the " & " operator in C ...

What's wrong with Linq to SQL?

What's wrong with Linq to SQL? Or - what about Linq to SQL would make it unsuitable for a project, either new or existing? I want to hear about why you would not choose Linq to SQL for a particular project - including what project parameters make it unsuitable. ...

How do i set the dns search suffix for a network adapter in .net?

I've written a command line utility that detects which network interface is connected, and sets the staitc ip address and dns servers for it (by calling netsh). However, I can't seem to figure out how to set the dns search suffixes. netsh doesnt appear capable of doing that. How do I do that otherwise (WMI perhaps)? ...

Redirect the parent frame inside an UpdatePanel on PostBack

This is kind of a weird problem, but I have to create a search box for our site that will be iframed on another site. When the user clicks the search button, it needs to redirect the parent frame to our search results page. At the moment what I've done is to make the search button a postback trigger then registering a client script blo...

How do you force a .net application to display on a particular monitor in a dual monitor setup?

I would like to run multiple copies of my application and force the first to open on one monitor and the second instance on a second monitor ...

Flowlayout panel not display the scroll bar after some resizes.

I have a flowlayout panel and on a resize event, I resize all the controls inside the flowlayout panel so they the width of the (flowlayoutpanel - padding - scroll bar width). On some resizes, the scroll bar is not shown, hiding most of the controls outside the area of the flowlayoutpanel while on other resizes the scroll bar is shown.I...

STAThread and multithreading

From the MSDN article on STAThread: Indicates that the COM threading model for an application is single-threaded apartment (STA). (For reference, that's the entire article.) Single-threaded apartment... OK, that went over my head. Also, I read somewhere that unless your application uses COM interop, this attribute actually does no...

relative paths in visual studio

I'm working in Visual Studio 2005 and have added a text file that needs to be parsed by right-clicking the project in the solution explorer and add --> new item. This places the .txt file to the project folder. The debug .exe file is in the /bin/debug folder. My main question is how to properly point to the txt file from code using rel...

Why do these two date formats differ?

I'm trying to produce just the day number in a WPF text block, without leading zeroes and without extra space padding (which throws off the layout). The first produces the day number with a space, the second produces the entire date. According to the docs, 'd' should produce the day (1-31). string.Format("{0:d }", DateTime.Today); strin...

How does ItemContainerGenerator.ContainerFromItem work with a grouped list?

I have a ListBox which until recently was displaying a flat list of items. I was able to use myList.ItemContainerGenerator.ConainerFromItem(thing) to retrieve the ListBoxItem hosting "thing" in the list. This week I've modified the ListBox slightly in that the CollectionViewSource that it binds to for its items has grouping enabled. Now...

Collection Editor at runtime

Hi, I'm working on an application to edit name/value pairs using a property grid. Some of the properties in my class file are ListDictionary collections. Is there an Editor attribute that I can apply at the property declaration that will make the Collection Editor work at runtime? If not, is it possible to inherit from ComponentMod...

How do I get the filename of the currently playing file in Vista Media Center?

I have Windows Vista MCML app, and I need to figure out the current name of the file playing. The Media Center SDK alludes to using MediaMetadata["Title"] to get this information, unfortunately this does not work with playlists (.wpl) files as there is no method for getting the position in the playlist. ...

Assembly dependencies with .Net projects

If I have an assembly (A) which references another assembly (B). I want to reference A in a project, I add the reference and it copies A into my BIN directory. It does not copy B as well, even though A depends on it, so the code doesn't compile. How can I set things up so that whenever I reference A, both A and B get copied to my bin d...

Is there a way to count the number of IL instructions executed?

I want to do some benchmarking of a C# process, but I don't want to use time as my vector - I want to count the number of IL instructions that get executed in a particular method call. Is this possible? Edit I don't mean static analysis of a method body - I'm referring to the actual number of instructions that are executed - so if, for ...

Dynamic Database Binding in C#

I have a project here that connects to an in-production database and grabs tables and views. The code I've inherited connects to a SQL Server database via a SqlConnection, with the user's provided credentials and the database location they provide. When data is required, it uses the connection and a SQL string to create a SqlDataAdapter,...

.NET Date Compare: Count the amount of working days since a date?

What's the easiest way to compute the amount of working days since a date? VB.NET preferred, but C# is okay. And by "working days", I mean all days excluding Saturday and Sunday. If the algorithm can also take into account a list of specific 'exclusion' dates that shouldn't count as working days, that would be gravy. Thanks in advance...

Mono created features available on .NET?

I noticed the following today: Mono at the PDC 2008? My talk will cover new technologies that we have created as part of Mono. Some of them are reusable on .NET (we try to make our code cross platform) and some other are features that specific to Mono's implementation of the CLI. Posted by Miguel de Icaza on 01 Oct 2008 Does any...