.net

Where should a C#/.NET alpha geek be looking for a job?

Just curious, at which companies do really good C# developers work? (I'm talking world-wide, not just in USA.) ...

.NET Deployment (ClickOnce or MSI) Client Settings/Parameters

I've created a windows forms application. I have a requirement of storing some information (in the Registry, Isolated Storage or other serialization method) like ClientID which is a GUID generated from a registration form before the user can download the installation package which is currently ClickOnce deployed. The application is run o...

.Net open source clustering products? ... like Terracotta

Does .Net have any open source clustering products like terracotta (http://www.terracotta.org/)? Thanks ...

Opening a "known file type" into running instance of custom app - .NET

How would you open a file (that has a known file/app association in the registry) into a "running instance" of the application it's supposed to open in? An example would be, I have Excel open and I click on an XLS file.....the file opens up in the current Excel instance. I want to do this for a custom application...how does the eventing/...

How stable/usable is SqlRoleProvider & aspnet_regsql?

Hi All, this isn't asp.net specific, some of these apps are WinForms, also will be adding some Wpf and possibly some silverlight apps in the future. I’ve a requirement to put role & permissions based access security into a new app we’re developing here. The .net RoleProviders in general, and SqlRoleProvider in particular seem to have e...

ASP.Net 2.0 VB WebSite Project "Type 'Exception' is not defined"

All of a sudden our VB ASP.Net 2.0 WebSite Project started complaining that Exception was not defined. I have discovered that if I add "Imports System" to the header, or explicitly use System.Exception that it works, but this error permeates a lot of other System descendants like the Data namespace, and the DateTime object. We have hun...

What's the best method for setting up a new .NET project?

So I'm newly in charge of projects at my company (We're still only 2 guys, but we're growing) and I want to set up my projects the right way. All my projects are in an SVN repo already, I've got bug tracking software set up, but what I'm looking for is the best way to layout a new project with tests, SVN, and a build server. I want to s...

Unit-tests and validation logic

I am currently writing some unit tests for a business-logic class that includes validation routines. For example: public User CreateUser(string username, string password, UserDetails details) { ValidateUserDetails(details); ValidateUsername(username); ValidatePassword(password); // create and return user } Should my t...

Winforms WPF interop performance

My project requires a background thread to initiate the creation of a WPF control hosted in a Winform. The creation of said control must be performed on the foreground thread, which is very costly and causes the UI to hang for 1 to 2.5 seconds (depending on whether this is the first time the control is created). Are there any pre creat...

How would you create a safe int sum IList extension ?

I would like to create a safe sum extension method that would have the same syntax as the normal Sum. This would be the syntax I'd like to use: result = Allocations.SumIntSafe(all => all.Cost); I use the Int.Maxvalue as a penalty value in my operations and two Int.MaxValue summed together returns a Int.Maxvalue. This is my adding fun...

What is the memory overhead of storing data in a .NET DataTable?

I'm trying to get a handle on the amount of memory overhead associated with a .NET DataTable, and with individual DataRows within a table. In other words, how much more memory does a data table occupy than what would be needed simply to store a properly typed array of each column of data? I guess there will be some basic table overhead, ...

Collapsible member events in Visual Studio designer

How can I get my control members to show their events on the Visual Studio event grid? Visual Studio does this for certain things like the "(DataBindings)" member by putting them in a collapsible section, like so: I'd like to do this for some of my own components, since their events are usually handled on the form, and having to creat...

Lambda closure or class level variable?

Just a general question about what the best practice is: public void Foo() { int x = 5; myControl.Click += (o, e) => { x = 6; }; } Notice, I'm using the x variable inside my lambda event handler. OR: public class Bar { private ...

What will be the lifespan of the .Net Framework?

Will it ever become obsolete? ...

Detecting whether a file is locked by another process (or indeed the same process)

This is how I do it at the moment. I try to open the file with the FileShare set to none. So I want exclusive accesss to the file. If I can't get that then its a good bet somebody else has the file locked. There's got to be a better and faster way. Any ideas? try { using (FileStream fs = File.Ope...

Checking for null, which is better? "null ==" or "==null"

Dupe: http://stackoverflow.com/questions/302701/null-difference A lifetime ago I came across an article that explained that the following were not equal (in c#): if (o == null) {} if (null == o) {} The article explained that the latter was preferred because it resulted in a more accurate test. I've been coding like that ever since. N...

Is it possible for native class to consume .NET event?

Any idea how to initialize .NET delegate that points to method from 'mixed' class instance? I have 'mixed' C++ class like this: class CppMixClass { public: CppMixClass(void){ dotNETclass->StateChanged += gcnew DotNetClass::ServiceStateEventHandler(&UpdateHealthState); } ~CppMixClass(void); void UpdateState(System:...

Regex boolean not

How do I write a .net regex which will match a string that does NOT start with "Seat" ...

ASP.NET: WCF and Could not load file or assembly 'App_Web_hamznvwf

I have recently begun working with AJAX-Enabled WCF, and have been plagued with this .NET caching issue - Could not load file or assembly App__Web__hamznvwf I was having issues with this 4 to 5 times a day on my server (Win 2003) - see first post So I moved my files off of the server and started running the project locally (Win XP). Ar...

regular expression lookaround

I don't think this is possible with just regular expressions, but I'm not an expert so i thought it was worth asking. I'm trying to do a massive search and replace of C# code, using .NET regex. What I want to do is find a line of code where a specific function is called on a variable that is of type DateTime. e.g: axRecord.set_Field("...