.net

Multithreading libraries for C#/.NET

I used mupltiple threads in a few programs, but still don't feel very comfortable about it. What multithreading libraries for C#/.NET are out there and which advantages does one have over the other? By multithreading libraries I mean everything which helps make programming with multiple threads easier. What .NET integratet (i.e. like ...

How do I create a (32-bit) .NET application to use 3 GB RAM?

I am creating a .NET application (C#) that needs to use a lot of RAM. I recently knew that on 32-bit versions of Windows XP I can only use 2 GB, unless I use the /3Gb switch, and set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag in the executable header. But since I'm developing a .NET application, I guess I cannot modify the executable direct...

WCF security problem

Some background: in order to provide authentication I'm using certificates on client and server side (WCF) and use one certificate for all clients (manually loading it from application directory - not the safest way, but it doesn't require to manage certificate storage and making installation more difficult): AddressHeader host...

.Net1 MenuItem vs. .Net2 ToolStripMenuItem -> Select Event

In .Net1.1 i used a MenuItem Select Event, but for the ToolStripMenuItems this Event doesn't seem to exist. What is the alternative? Edit: MouseEnter or MouseHover doesn't catch Menu Selection via the Keyboard. ...

How to serialize an IList<T>?

I've got an OR mapper (iBatis.Net) that returns an IList. // IList<T> QueryForList<T>(string statementName, object parameterObject); var data = mapper.QueryForList<Something>(statement, parameters); I'm trying to use it in an webservice an want to return the data 1:1. Of course I can't return IList in a WebMethod, because it is an int...

Returning Rows from a .NET Web Service

I am using a .NET web service as an interface to a database. What is the best way to return rows from this web service? I vaguely remember that .NET 2.0 had issues with returning DataTable objects. Do those issues still exist? Update: Some of the issues in .NET 1.1. Also, I believe that in 2.0 the DataTable is deserialized as a DataSet...

How to create empty local databases based on an existing .sdf file on VS2008 and SQL Server Compact

I'd like to use Visual Studio 2008 IDE for editing my local database schema for a SQL Server Compact 3.5 database. However, everything in the documentation and in the UI seems to make an assumption that the application/assembly only wants to use a single database and never wishes to create new ones based on the existing schema. I'd lik...

.NET: Asynchronous rollback due to Transaction timeout

In a C# project, I have a (volatile) transactional resource enlisted in a System.Transactions.Transaction. When a transaction timeout occurs, the rollback is executed in a worker thread: Obviously, the transaction uses a timer and calls a timer callback when the timer elapses (there is very little documentation from MS on this issue). Th...

What are the benefits of List<T>.Find over alternatives?

Recently I used a predicate to describe search logic and passed it to the Find method of a few Lists. foreach (IHiscoreBarItemView item in _view.HiscoreItems) { Predicate<Hiscore> matchOfHiscoreName = (h) => h.Information.Name.Equals(item.HiscoreName); var current = player.Hiscores.Find(matchOfHiscoreName); item.Ge...

Can't alter DisplayMember in WinForms ComboBox

I'm trying to alter how a combobox is displayed using the following code: private void UpdateMapRoadPointList(List<GeographicAddress> plstMapRoadPointList) { cboFind.DataSource = plstMapRoadPointList; cboFind.DisplayMember = "ShortCode"; cboFind.ValueMember = ""; } GeographicAddress is a class which...

Redistribution licensing of .NET classes

I have very little experience with licensing issues. Let's say I'm developing an application for .NET 2.0. Is it OK to use (and distribute) some .NET 3.5 DLL's with my application? For example, could I just copy "System.Core.dll" in my setup to the client's machine? Or could I even just extract some class (e.g. using Reflector), put its...

How to tell in .NET whether you are running on x86 or x64?

Hi, Is there a way in .NET (3.5 or less) to tell if a console application is running on x86 or x64? Thanks Paul ...

custom service failed to start when there is a unscheduled reboot on the server?

I created a service and what it does is writing information into a xml file. Sometime, it seem to happen mostly with unscheduled reboot, the service cannot start because the file used is "locked". This error happen while the system is still starting up since my service is set to "auto start". This is under windows 2003. Anyone know wh...

Benefits of console app over windows service

I have a .Net console App which using a scheduled event will start, call a mweb service method and the close. This runs every hour/every day. Whilst there is nothing 'wrong' with the implementation I was wondering if there was any benefit to implementing this as a windows service. Has anyone any views of what would be the best practice...

Merging two images in C#/.NET

Simple idea: I have two images that I want to merge, one is 500x500 that is transparent in the middle the other one is 150x150. Basic idea is this: Create an empty canvas that is 500x500, position the 150x150 image in the middle of the empty canvas and then copy the 500x500 image over so that the transparent middle of it allows the 150x...

What ever happened to XPathReader

XPathReader is/ was an implementation of a forward reading XML parser (built on XMLReader) which allowed you to register XPath queries for it to find (or at least a subset of XPath called Sequential XPath). This seems to be the perfect choice for easy access to elements of xml streams, or case where you just need to pull some information...

Extract results from List<Customers> using LINQ

I have a List of Customers List<Customers> cust = new List<Customers>(); cust.Add(new Customers(){ID=1, Name="Sam", PurchaseDate=DateTime.Parse("01/12/2008")}); cust.Add(new Customers(){ID=2, Name="Lolly" PurchaseDate=DateTime.Parse("03/18/2008")}); I want to show 2 seperate results like: Purchases by Customer in Yr // Grouping by...

Designing services and operations in WCF.

Hi, I would appreciate some guidance on modelling services and operations in WCF. I have a series of business domains, each with bespoke methods that I want to able to use over WCF. I guess an OO view would be something like: interface IBusinessDomain1 { MyClass1 Method1(...) MyClass2 Method2(...) } interface IBusinessDomain2...

What OR/M tool that supports Linq/Iqueryable would you recommend?

I asked this question reguarding the use of Linq-2-Sql with the Rob Conery's use of the Repository in his MVC Storefront app and got an excellent response from Matt Briggs: L2S is used to generate the DAL, but the only thing that should know about the DAL is the repository, so a translation is made to his domain objects. ...

MSI Error Code 2869 on Vista

I have an MSI for a .NET application that I created using Visual Studio 2005 that includes a custom action to write some registry keys at the end of the install. I found that the installer works fine on Windows XP SP2 and SP3. However, when I try to run the installer on a Vista PC, the installer seems to get almost all the way to the e...