.net

SelectNodes not working on stackoverflow feed

I'm trying to add support for stackoverflow feeds in my rss reader but SelectNodes and SelectSingleNode have no effect. This is probably something to do with ATOM and xml namespaces that I just don't understand yet. I have gotten it to work by removing all attributes from the feed tag, but that's a hack and I would like to do it properl...

How does .net managed memory handle value types inside objects?

public class MyClass { public int Age; public int ID; } public void MyMethod() { MyClass m = new MyClass(); int newID; } To my understanding, the following is true: The reference m lives on the stack and goes out of scope when MyMethod() exits. The value type newID lives on the stack and goes out of scope when MyMet...

Windows: List and Launch applications associated with an extension

How to determine the applications associated with a particular extension (e.g. .JPG) and then determine where the executable to that application is located so that it can be launched via a call to say System.Diagnostics.Process.Start(...). I already know how to read and write to the registry. It is the layout of the registry that makes...

InvalidOperationException while creating wcf web service instance

I have a WCF Web Service which is referenced from a class library. After the project is run, when creating the service client object from inside a class library, I receive an InvalidOperationException with message: Could not find default endpoint element that references contract 'MyServiceReference.IMyService' in the ServiceModel client...

Building C# .NET windows application with multiple views

I'm rewriting an old application and use this as a good opportunity to try out C# and .NET development (I usually do a lot of plug-in stuff in C). The application is basically a timer collecting data. It has a start view with a button to start the measurement. During the measurement the app has five different views depending on what inf...

Is there any way to automate windows forms testing?

I am familiar with nunit for unit testing of the business layer however I am looking now to automate the test of the win forms gui layer. I have seen watin and the watin recorder for automating tests on web application by accessing the controls and automating them. However I am struggling to find a watin equivalent for windows forms (...

What would be the fastest way to remove Newlines from a String in C#?

Hi community, I have a string that has some Environment.Newline in it. I'd like to strip those from the string and instead, replace the Newline with something like a comma. What would be, in your opinion, the best way to do this using C#.NET 2.0? Thanks in advance. ...

How can I represent a very large integer in .NET?

Does .NET come with a class capable of representing extremely large integers, such as 100 factorial? If not, what are some good third party libraries to accomplish this? ...

How costly is Reflection? Really.

I constantly hear how bad reflection is to use. While I generally avoid reflection and rarely find situations where it is impossible to solve my problem without it, I was wondering... For those who have used reflection in applications, have you measured performance hits and, is it really so bad? ...

When is NavigationService initialized?

I want to catch the NavigationService.Navigating event from my Page, to prevent the user from navigating forward. I have an event handler defined thusly: void PreventForwardNavigation(object sender, NavigatingCancelEventArgs e) { if (e.NavigationMode == NavigationMode.Forward) { e.Cancel = true; } } ... and that wo...

How can I get the name of the executing .exe?

The Compact Framework doesn't support Assembly.GetEntryAssembly to determine the launching .exe. So is there another way to get the name of the executing .exe? EDIT: I found the answer on Peter Foot's blog: http://peterfoot.net/default.aspx Here is the code: byte[] buffer = new byte[MAX_PATH * 2]; int chars = GetModuleFileName(IntPtr....

What's the simplest way to connect to a .NET remote server object

Given that my client code knows everything it needs to about the remoting object, what's the simplest way to connect to it? This is what I'm doing at the moment: ChannelServices.RegisterChannel(new HttpChannel(), false); RemotingConfiguration.RegisterWellKnownServiceType( typeof(IRemoteServer), "RemoteServer.rem", WellKnownObjectM...

How can I figure out how much memory a .Net Appdomain is consuming?

I'm trying to programmatically restrict the memory consumption of plugins running in a .Net AppDomain, but I can't find any setup parameters for this, nor can I find a way to query an AppDomain to figure out how much memory it is consuming. Any ideas? ...

Failed to load resources from resource file.

Get the following error periodically in an IIS application: Failed to load resources from resource file. The full error message in the Application Event Log is: Event Type: Error Event Source: .NET Runtime Event Category: None Event ID: 0 Date: 8/8/2008 Time: 8:8:8 AM User: N/A Computer: BLAH123 D...

Is it possible to Embed Gecko or Webkit in a Windows Form just like a WebView?

Hi, I'd love to know if there is such thing as a Gecko.NET ;) I mean, just like we can embed a WebView and that is an "instance" of IE7 inside any Windows Forms application (and tell it to "navigateto (fancy_url);", I'd love to use FireFox or WebKit. Anybody tried this? UPDATE: Please bear in mind that although it is possible to embed...

What is the best way to store user settings for a .NET application?

I have a .NET 2.0 Windows Forms application. Where is the best place the store user settings (considering Windows guidelines)? Some people pointed to Application.LocalUserAppDataPath. However, that creates a folder structure like: C:\Documents and Settings\user_name\Local Settings\Application Data\company_name\product_name\product_vers...

.NET Multi Dimensional Array Printing

Let's say I have a .NET Array of n number of dimensions. I would like to foreach through the elements and print out something like: [0, 0, 0] = 2 [0, 0, 1] = 32 And so on. I could write a loop using some the Rank and dimension functions to come up with the indices. Is there a built in function instead? ...

sizeof() equivalent for reference types?

I'm looking for a way to get the size of an instance of a reference type. sizeof is only for value types. Is this possible? ...

Free POP3 .NET library?

Looking for a POP3 Client for .NET that basically just lets me log into a server and grab all the emails out, and maybe send some. I grabbed Indy.Sockets off of CodePlex and got it running but its throwing errors trying to decode the mail headers. Really anything is fine if it works. ...

Internalize Class and Methods in .NET Assembly

I have a set of multiple assemblies (one assembly is to be used as an API and it depends on other assemblies). I would like to merge all assemblies into one single assembly but prevent all assemblies except the API one to be visible from the outside. I will then obfuscate this assembly with Xenocode. From what I have seen, it is impossi...