.net

What path should I pass as an AssemblyPath parameter to the Publish.GacRemove function?

I want to use the Publish.GacRemove function to remove an assembly from GAC. However, I don't understand what path I should pass as an argument. Should it be a path to the original DLL (what if I removed it after installing it in the GAC?) or the path to the assembly in the GAC? UPDATE: I finally used these API wrappers. ...

Automate Deployment for Web Applications?

My team is currently trying to automate the deployment of our .Net and PHP web applications. We want to streamline deployments, and to avoid the hassle and many of the headaches caused by doing it manually. We require a solution that will enable us to: Compile the application Version the application with the SVN version number Backu...

How many app.config files are you allowed to have per AppDomain?

I'm hoping there's a way to avoid custom configuration files if an application runs in a single AppDomain. ...

Choosing a folder with .NET 3.5

In a C# .NET 3.5 app (a mix of WinForms and WPF) I want to let the user select a folder to import a load of data from. At the moment, it's using System.Windows.Forms.FolderBrowserDialog but that's a bit lame. Mainly because you can't type the path into it (so you need to map a network drive, instead of typing a UNC path). I'd like somet...

How to change "Generate Method Stub" to throw NotImplementedException in VS?

How can I change default Generate Method Stub behavior in Visaul Studio to generate method with body throw new NotImplementedException(); instead of throw new Exception("The method or operation is not implemented."); ...

How do I group in memory lists?

I have a list of Foo. Foo has properties Bar and Lum. Some Foos have identical values for Bar. How can I use lambda/linq to group my Foos by Bar so I can iterate over each grouping's Lums? ...

What is the best way to set the permissions for a specific user on a specific folder on a remote machine?

We have a deployment system at my office where we can automatically deploy a given build of our code to a specified dev environment (dev01, dev02, etc.). These dev environments are generalized virtual machines, so our system has to configure them automatically. We have a new system requirement with our next version; we need to give certa...

Can a service have multiple endpoints?

We have a service that has some settings that are support only over net.tcp. What's the best way to add another endpoint? Do I need to create an entire new host? ...

Plug In Design for .NET App

I’m looking at rewriting a portion of our application in C# (currently legacy VB6 code). The module I am starting with is responsible for importing data from a variety of systems into our database. About 5-6 times a year, a new client asks us to write a new import for the system that they use. Presently, this requires us to release a ne...

.NET Console Application Tab Completion

Any ideas on how to implement tab completion for a .NET (C#) Console Application? And I mean within an application that is run and then loops for user input (like if you run ftp.exe without any arguments), like this: string line = string.Empty; while (line != "exit") { //do something here ...

Windows packet sniffer that can capture loopback traffic?

(This is a followup to my previous question about measuring .NET remoting traffic.) When I am testing our Windows service / service controller GUI combination, it is often most convenient to run both pieces on my development box. With this setup, the remoting traffic between the two is via loopback, not through the Ethernet card. Are t...

How do I specify multiple constraints on a generic type in C#?

What is the syntax for placing constraints on multiple types? The basic example: class Animal<SpeciesType> where SpeciesType : Species I would like to place constraints on both types in the following definition such that SpeciesType must inherit from Species and OrderType must inherit from Order: class Animal<SpeciesType, OrderType>...

WebBrowserControl Scroll to Bottom

I am working on a simple chat application using a System.Windows.Forms.WebBrowser Control to display the messages between the user and the recipient. How do I get the control to automatically scroll to the bottom every time I update the DocumentText of the control? ...

Read Access File into a DataSet

Is there an easy way to read an entire Access file (.mdb) into a DataSet in .NET (specifically C# or VB)? Or at least to get a list of tables from an access file so that I can loop through it and add them one at a time into a DataSet? ...

Automated Unit Testing Gen Tools for .NET

Looking to get your take on an automated testing tool (voting should bring good ones to the top) Ideal tool would: Eliminate the need to present a set of values to a method. employ techniques such as Interactive Exploratory Testing where the code is examined to determine what values are required to exercise all code paths. i.e. the ...

Do namespaces propagate to children in XElement objects?

If I have an XElement that has child elements, and if I remove a child element from the parent, removing all references between the two, will the child XElement have the same namespaces as the parent? In other words, if I have the following XML: <parent xmlns:foo="abc"> <foo:child /> </parent> and I remove the child element, will...

.Net 3.5, most secure way to pass string between processes

I'd like to be able to pass a SecureString (a cached passphrase) to a child process in C# (.Net 3.5), but I don't know what the most secure way is to do it. If I were to convert the SecureString back to a regular string and pass it as a command-line argument, for example, then I think the value may be prone to disk paging--which would ma...

Custom cursor in WPF?

I want to use an image or icon as a custom cursor in WPF app. What's the best way to do it? ...

Where do attached properties fit in a class diagram?

What is the most appropriate way to represent attached properties in a UML diagram or an almost-uml diagram like the VS2008 class diagram? ...

C# .NET + PostgreSQL

I'm looking at working on a project which uses C#.NET (sitting on a windows box) as the primary language and PostgreSQL as the backend database (backend is sitting on a linux box). I've heard that ODBC.NET allows for easy integration of these two components. Has anyone had experience actually setting C# and PostgreSQL up to work toge...