.net

Getting started with Silverlight development..

How does one start development in Silverlight? Does one need a new IDE? or Visual studio will support? ...

Where can I find a FTP Server with an API?

I am looking for a FTP Server that has a decent API. It would be great if I could code use the .NET Framework. I am currently using Secure FTP from GlobalSCAPE but I have had less than plesant experiences working with it. ...

Is SqlCommand.Dispose enough?

Can I use this approach efficiently? using(SqlCommand cmd = new SqlCommand("GetSomething", new SqlConnection(Config.ConnectionString)) { cmd.Connection.Open(); // set up parameters and CommandType to StoredProcedure etc. etc. cmd.ExecuteNonQuery(); } My concern is : Will the Dispose method of the SqlCommand (which is calle...

How do you find out the ProductCode from a .Net Installer class custom action

I need to know the application's ProductCode in the Installer.OnCommitted callback. There doesn't seem to be an obvious way of determining this. ...

Close and Dispose - which to call?

Having read the threads Is SqlCommand.Dispose enough? and Closing and Disposing a WCF Service I am wondering for classes such as SqlConnection or one of the several classes inheriting from the Stream class does it matter if I close Dispose rather than Close? ...

How to save the output of a console application

I need advice on how to have my C# console application display text to the user through the standard output while still being able access it later on. The actual feature I would like to implement is to dump the entire output buffer to a text file at the end of program execution. The workaround I use while I don't find a cleaner approach...

Tools to create maximum velocity in a .NET dev team

If you were to self-fund a software project which tools, frameworks, components would you employ to ensure maximum productivity for the dev team and that the "real" problem is being worked on. What I'm looking for are low friction tools which get the job done with a minimum of fuss. Tools I'd characterize as such are SVN/TortioseSVN, Re...

How do you resolve .Net namespace conflicts with the 'using' keyword ?

Here's the problem, you include multiple assemblies and add 'using namespaceX' at the top of your code file. Now you want to create a class or use a symbol which is defined in multiple namespaces, e.g. System.Windows.Controls.Image & System.Drawing.Image Now unless you use the fully qualified name, there will be a crib/build error due ...

Breakpoints in core .NET runtime?

I have a third party library that internally constructs and uses the SqlConnection class. I can inherit from the class, but it has a ton of overloads, and so far I have been unable to find the right one. What I'd like is to tack on a parameter to the connection string being used. Is there a way for me to put a breakpoint in the .NET lib...

How to get entire chain of Exceptions in Application.ThreadException event handler?

I was just working on fixing up exception handling in a .NET 2.0 app, and I stumbled onto some weird issue with Application.ThreadException. What I want is to be able to catch all exceptions from events behind GUI elements (e.g. button_Click, etc.). I then want to filter these exceptions on 'fatality', e.g. with some types of Exceptions...

Rolling your own message loop, any pitfalls?

This question is slightly related to this question about exception handling. The workaround I found there consists of rolling my own message loop. So my Main method now looks basically like this: [STAThread] static void Main() { // this is needed so there'll actually an exception be thrown by // Application.Run/Application.DoEvents...

How do I make a ListBox refresh its item text?

I'm making an example for someone who hasn't yet realized that controls like ListBox don't have to contain strings; he had been storing formatted strings and jumping through complicated parsing hoops to get the data back out of the ListBox and I'd like to show him there's a better way. I noticed that if I have an object stored in the Li...

Is .NET/Mono or Java the better choice for cross-platform development?

How much less libraries are there for Mono than for Java? I lack the overview over both alternatives but I have pretty much freedom of choice for my next project. I'm looking for hard technical facts in the areas of performance (for example, I'm told Java is good for threading, and I hear the runtime code optimization has become very ...

How to add uninstall option in .NET Setup Project?

The .NET Setup project seems to have a lot of options, but I don't see an "Uninstall" option. I'd prefer if people could "uninstall" from the standard "start menu" folder rather than send them to the control panel to uninstall my app, so can someone please tell me how to do this? Also, I am aware of non Microsoft installers that have...

Adding assemblies to the GAC from Inno Setup

Until recently we were using Inno Setup for our installations, something I would like to continue doing, unless we can get an uninstall option in the start menu (thanks Giovanni Galbo), however we now need to GAC some external libraries, something I suspect is only doable (or at least only supported) though the .NET Setup Project. Is it...

Anyone using WPF for real LOB applications?

Anyone using WPF for real LOB applications? We have all seen the clever demos of WPF showing videos mapped onto 3D elements. These look great but what about the real world of line-of-business applications that make up the majority of developers efforts. Is WPF just for nice eye candy? ...

VS 2005 Toolbox kind of control .NET

Hi, I'm looking for a control that the Visual Studio "Toolbox" menu uses. It can be docked and can retract (pin). Would you know where I can find a control or COM I could use which would look like this? ...

How do you bind an Enum to a DropDownList control in ASP.NET?

Let's say I have the following simple enum: enum Response { Yes = 1, No = 2, Maybe = 3 } How can I bind this enum to a DropDownList control so that the descriptions are displayed in the list as well as retrieve the associated numeric value (1,2,3) once an option has been selected? ...

DateTime.Now vs. DateTime.UtcNow

I've been wondering what exactly are the principles of how the two properties work. I know the second one is universal and basically doesn't deal with time zones, but can someone explain in detail how they work and which one should be used in what scenario? ...

Would you bother to mock StreamReader object ?

Hello, I use a stream reader to import some data and at the moment I hardcode a small sample file in the test to do the job. Is it sensible to use Mock Objects with this and how ? ...