.net

Self Updating Application

Hi All, I have a general question for the group. I am about to start a large project for my team that, I suspect, we will be doing as a desktop application (I am generally a web guy in my application outlook but I am open to change.) My big concern is that the current desktop applications in the company are already a pain in the keiste...

Visual Studio file selector

I am new to .NET and the Visual Studio IDE. How to I add to a form a component that lets the user browse the file system to select a certain file which will then allow me to programmatically use the selected path as a string variable? ...

Why isn't there a SelectedNodeChanged event for Windows.Forms.TreeView?

The System.Web.UI.WebControls.TreeView class offers this event, but the Forms version of TreeView doesn't. What's the equivalent in the Forms world? I'm using AfterSelect but it doesn't seem quite right. Maybe it is in fact what I'm looking for but the documentation is a bit hazy. ...

Simple self-contained SNMP Agent example? (java/c# ideal)

After not having a whole bunch of luck finding any SNMP libraries for .NET that can act as SNMP agents (that can be used in an OSS project - meaning proprietary libs are out), I am now looking at implementing a simple SNMP agent class in C#. Can anyone provide any good examples or reference implementations of an SNMP agent (ideally nice...

One reader, many writers

Related: How to catch exceptions from a ThreadPool.QueueUserWorkItem? I am catching exceptions in background threads started by ThreadPool.QueueUserWorkItem(), and propagating them to the main thread via a shared instance variable. The background threads do this: try { ... stuff happens here... } catch (Exception ex1) { lock...

Debugging WCF service library--how to "run" it?

I have the source to two Visual Studio solutions. One is a website that calls a WCF service, and the other solution is a WCF service that compiles into a DLL. The website has the WCF service's binary DLL as a reference. Here's the problem: when I run the website, an uncaught exception makes its way up from the WCF service. How do I run...

Visual Studio Debugging Referenced DLL

I have an ASP.NET web site uses a compiled DLL from another VS.NET solution (have the DLL's original solution--.cs files, .csproj, .sln, etc) as a reference. There's an exception coming up to the web site from this DLL and I'd like to debug it (the DLL). Can I do this? Can I drill down into the DLL, set break points, etc. somehow? I've h...

What is the best tool for Test driven Development using asp.net 2.0?

We are using Asp.Net 2.0 and planning to move to TDD so that middle tier can be developed and tested while others in the team take care of UI and DataBase area. Can anyone kindly let me know the pre-requisites for TDD and which one is the best tool for .net? Thanks... [UPDATE] Thanks everyone for your answers and help. I was readin...

How do I manipulate Handler Mappings cleanly in IIS7 using the Microsoft.Web.Administration namespace?

When manipulating Handler Mappings using the Microsoft.Web.Administration namespace, is there a way to remove the <remove name="handler name"> at the site level. For example, I have a site which inherits all the handler mappings from the global handler mappings configuration. In applicationHost.config the <location> tag initially looks ...

Is there a general-purpose object pool for .NET?

I have a class that is expensive to construct, in terms of time and memory. I'd like to maintain a pool of these things and dispense them out on demand to multiple threads in the same process. Is there a general-purpose object pool that is already tested and proven? (I don't want COM+ pooling.) ...

How to override HttpStyleUriParser/GenericUriParser for HTTP-like URLs?

I'd like to override HttpStyleUriParser, since I only want to modify it slightly. Microsoft also states (See MSDN) Microsoft strongly recommends that you use a parser shipped with the .NET Framework. Building your own parser increases the complexity of your application, and will not perform as well as the shipped parsers. However, ...

unique key value collection in C#

I want to build 2-dimentional collection where i need unique combination of key value pairs. For example Domain "Company" (Id: 1) can have MachineName "Machine1" and "Machine2", but cannot add another MachineName "Machine1" again. Another Domain "Corporate" (Id:2) can have another machineName "Machine1". here my collection will be like ...

When doing a Process.Start() do you need to wrap it in a using?

When you are starting a process and dont care about the result is this ok? Process.Start(xxx); Or should you do this using (Process.Start(xxx)){} ...

What are the implications for Async I/O (BeginWrite/BeginRead) with a chain of streams?

Suppose I have a chain of streams, that does Compression -> Encryption -> File I/O. In C#, using synchronous I/O, it would look something like this: int n=0; byte[] buffer= new byte[2048]; string inputFileName = "input.txt"; string outputFileName = inputFileName + ".compressed.encrypted"; using (FileStream inputFileStream...

synchronization database for windows application in vb.net

i have a windows application made in VB.NET which maintains a database, and i have similar application running across many disconnected machines, all of them have similar databases. Now we have a requirement that all the data from these machines must be uploaded on a central database server MSSQL on a daily basis, we can have an internet...

Cannot set OdbcConnection to OdbcCommand.Connection

Hi, On the class level, I have created reference: System::Data::Odbc::OdbcConnection Connection; in some method I want to set it to odbcCommand.Connection like this: ::System::Data::Odbc::OdbcCommand Command; Command.Connection=this->Connection; It reports "cannot convert parameter 1 from 'System::Data::Odbc::OdbcConnection' to 'Syst...

Why does GetDirectoryName return null for C:\?

I just came across what seems like a weird design choice: System.IO.Path.GetDirectoryName(@"C:\folder\file.ext") returns "C:\folder" but System.IO.Path.GetDirectoryName(@"C:\") returns null. I could understand it better if the first example returned "folder". Any ideas why this is the case? And what do you do when you just want ...

Does it make sense to write core/critical projects in .NET

.NET become to be more and more popular, lot of new systems are build base on it. People (including me) love .NET for many things. When I started my C# adventure the fact supporting this choice was London stock exchange have chosen .NET/ MS SQL Server for they transactional systems. Now I heard they withdraw from that (confirming opin...

Best practices of high-performance network applications

While testing out a UDP multicast server that I've written on Windows 7 Ultimate x64, I came across a most curious thing. Playing music with foobar2000 in the background significantly improved the server's transmission rate yet also incurred minor packet loss. Turning the music off immediately dropped the transmission rate to below accep...

How to create a .NET executable through a .NET windows forms application?

As described in the title I would like to develop a Windows Forms Application in .NET that is capable of creating at run-time another .NET command line or windows form executable and let me save it to disk. Do you have any ideas if it is possible and how to proceed? #Region "Some more info" I would like to create a form where the user...