.net

Visual Studio 8: Build Times in mixed-mode assemblies.

I have an C++/CLI assembly consisting of approximately 50 source files. The code in this assembly links statically to a number of C++ libraries to do various 'heavy-lifiting' type tasks. I am using Visual Studio 8 (2005) SP1 to build this assembly. Building just this assembly (without dependencies, etc) via 'Project Only'->'Rebuild On...

Is there a *clean* way to make a read-only dependency-property reflect the value of another property?

The code below is my current solution. If it takes you a couple minutes to figure out what this code is doing, I hear ya. This is an ugly mess if ever there was one. I would kill to see an alternative, (but don't let that discourage you from responding... :-). Oh jeez, I even abbreviated it (substantially) by removing the converter...

BindingRedirect to different assembly name

You can use BindingRedirect to redirect YourAssembly.dll 1.1.0.0 to 1.2.0.0. Does anyone know if its possible to do this if the assembly names are different. E.g. YourAssembly1.dll (v1.1) redirects to YourAssembly2.dll (v2.8) ...

Auto implementing looping

I don't know if the title makes sense, but in the app I am writing there are lots of (extension) methods. A simple example: Objects: Matter (Burn, Explode, Destroy, Freeze, Heat, Cool) Atom (Attach, Detach) <many more> And a custom collection like: ImmutableList<T> And methods like these: public static class Burner { public s...

How do I kill my mobile App?

I have this windows mobile application. I'd like to launch an updater.exe that will update my mobile app. But I need to stop my mobile app before the updater process launch .. how can I achieve this? ...

How to perform validation and feedback when using a PropertyGrid?

We're using the PropertyGrid to edit properties on a object and are looking for a means of providing validation. Specifically validation that indicates that the entire object is valid for being saved. Here's basic idea. Imagine two properties on a object Property: Widgets (a string collection) Property: DefaultWidget (a single s...

Can I stop a program during execution any other way than by throwing an error?

Is there a command that will stop the execution of my program? I have a service that is processes an exchange account via telnet every 10 minutes. During one point of execution the application could possibly have a response from the telnet session when there are NO e-mails in the folder, which would look something like this: * 0 EXIST...

Selecting (siblings) between two tags using XPath (in .NET)

I'm using .NET 3.5 (C#) and the HTML Agility Pack to do some web scraping. Some fields that I need to extract are structured as paragraphs within which components are separated by line-break tags. I'd like to be able to select out the individual components between the line-breaks. Each component may be formed from multiple elements (i.e....

"ignoring" P/Invoke when running on Mono

I have a WinForms Application that I want to run at Mono at some point. However, it is using some P/Invoke against user32.dll, which will cause an obvious problems. However, this is not a critical functionality, just some flavor stuff. So I would like to ignore it when running Mono. I know I could just use an #if directive, but then I ...

Is it a bad practice to reference System.Windows.Form in your Unit Test project?

I have a class that I want to test the DialogResult value for. To get that type I need to add a reference to System.Windows.Forms. Is it bad practice to have this included in a test project? ...

Configuring a POS printer using POS.NET

Is it possible to configure a POS printer service object (an Epson one) from a POS.NET application (such as configuring the IP address for a network connected printer)? It would be nice if it didn't need to be done separately through the applications that Epson provides. ...

Unit Testing and Code Coverage Frameworks for .Net?

I am about to start a new project and am looking around for both a unit testing framework and some sort of code coverage profiler. I've used the unit test framework in Visual Studio Pro in the past but I've never used a coverage framework. Does anyone have views on the best unit testing and code coverage frameworks around at the moment?...

Prescriptive advice on minimally invasive conversion from Remoting to WCF

Is the advice given in this oft-cited MSDN article still considered sound for converting a .NET Remoting application to WCF? I notice that the article references the deprecated ServiceBehavior attribute ReturnUnknownExceptionsAsFaults, so I question whether people have found other discrepancies or other approaches better suited to intr...

WinForms DataBinding to Objects - What is the equivalent to a DataRelation for allow navigation of Parent/Child Relationships?

WinForms databinding has very solid support for navigating related DataTables via DataRelation objects, but I'm having a difficult time finding resources for implementing similar functionality for databinding against a business object. Does anyone know of an equivalent to the DataRelation object, or know of any resources on implementing...

What does AddressFamily.FireFox refer to in .NET sockets?

In System.Net.Sockets.AddressFamily there are a number of obvious entries like InterNetwork, AppleTalk and Ipx. There's also one for "FireFox". I assume this has nothing to do with the "Firefox" browser since a. it's cased differently and b. why would the Firefox browser have its own network address type. So what the heck is this for...

Looking for MemberShip.GetAllUsers(startDate,endDate) functionality.

I'm creating a user approval interface leveraging the .Net Membership class. I have a page that does a Membership.GetAllUsers(), and I spit the results to a datagrid. I filter them by MembershipUser.IsApproved. My Issue is due to slowness I'm hitting while I GetAllUsers(). Since I don't need to pull down all of the users, but rather...

Microsoft Enterprise Library Caching Application Block not thread safe?!

Good aftenoon, I created a super simple console app to test out the Enterprise Library Caching Application Block, and the behavior is blaffling. I'm hoping I screwed something that's easy to fix in the setup. Have each item expire after 5 seconds for testing purposes. Basic setup -- "every second pick a number between 0 and 2. if th...

What does it mean if I don't provide an InitialCatalog in a OLEDB connection string?

I have a connection string (to an SQLServer 2005 database) which specifies a server, username and password, but does not specify an InitialCatalog. When I try and open connection it works, and I can list the tables, which lists a lot of tables, but not the table from the database I am interested in. What is it I am connected to when ...

How do I draw simple graphics in C#?

I just want to draw simple 2D objects like circle, line, square etc in C#. How do I do that? Back in the Turbo C++ days I remember initializing some graphics library for doing the same. Do I need to do something similar in .NET? Is it any different for 3D objects? Will things like DirectX make this any easier? Any links to tutorials or s...

Unrecognized escape sequence for string containing backslashes - in C#

string foo = "D:\Projects\Some\Kind\Of\Pathproblem\wuhoo.xml"; I get a compile error "Unrecognized escape sequence" for each backslash. I guess I need to escape backslash - how? ...