.net

Changing statemachine workflow at runtime error

I have a Windows Workflow Foundation (3.0) StateMachine workflow with about 20 states. I can successfully remove a simple state from it at runtime, but if the state is more complex (ie. it can transition into or from multiple states) I run into an error. Because properties can't be changed at runtime I have to remove activities and the...

Why is my StringReader 50us slower than the .NET StringReader?

In my test I created a string with 32000 characters. After repeated execution of the test the BCL StringReader consistently executed in 350us while mine ran in 400us. What kind of secrets are they hiding? Test: private void SpeedTest() { String r = ""; for (int i = 0; i < 1000; i++) { r += Randomization.GenerateString(...

access exchange 2003 calendars with vs2005+

I'm looking for a way to access Exchange 2003 calendars to add appointments. I'm hoping to use an admin account and impersonate each user to add appointments which i'm pulling from an oracle database. I've seen lots of examples for Exchange 2000 using cdox.dll which are exactly what I'm looking for but not an equivalent for 2003. I have ...

Web Services development using C# .NET - Compatibility Check

I would like to get some information on list of points that needs to be taken care of while developing Web Services on .NET platform using WCF to make sure it is compatible with majority of the clients out there (Java, .NET etc...). Earlier I have seen cases where we developed services which was easily consumed by .NET clients , however...

Best practices for signing assemblies with multiple projects and developers

I’m looking for recommendations and best practices for applying signed assemblies in an organization with 30+ developers, 20+ solutions and 60+ projects. We’re using Visual Studio Team System 2008 and TFS. While creating a key and signing the assembly is a very easy and straight forward procedure, I’m concerned how we manage this the be...

What is the point of Lookup<TKey, TElement> ?

The MSDN explains Lookup like this: A Lookup<TKey, TElement> resembles a Dictionary<TKey, TValue>. The difference is that a Dictionary<TKey, TValue> maps keys to single values, whereas a Lookup<TKey, TElement> maps keys to collections of values. I don't find that explanation particularly helpful. What is Lookup used for? ...

WiX Setup Project - Stop Building after every compilation

I have a visual studio 2008 solution with multiple c# library projects, a Web Project and a Wix Setup project. The setup project takes about 2 minutes to build. Currently when I do a build, it will build every project, including the setup project. I want to be able to build all projects, excluding the wix project when using the debu...

Too long string for WCF

I'm trying to send a long string by WCF, around 64k chars long. When sending a long string, the I get the HTTP error 400. But when I send shorter string, everything works fine. Here is the WCF interface and app.config that I use. My message contract: [MessageContract] public class MessageClass { [MessageHeader(MustUnderstand = true...

How to setup ClickOnce for multifile assemblies

My solution has 4 projects, each project contains many namespaces. Currently my DLL size is nearly 30 MB. Just a small change to a class means that the user needs to download a new version of the DLL which size is too large and it takes a long time. How can a ClickOnce project be set up for multifile assemblies? ...

.NET MPI implementation?

What is the most mature .NET MPI implementation? A quick google search turned up the two below, but I'm not familiar with either of them. I believe the first item (mpi.net) is based on Microsoft MPI. Any thoughts? http://www.osl.iu.edu/research/mpi.net/ http://www.purempi.net/ ...

What is the name of the control that combines the function of a button and a combobox?

What is the name of the control that combines the function of a button and a combobox? Visual Studio's open file dialog has this control for the "Open" button. You can select "Open" or "Open With". But once you select an action, the corresponding action is taken. Lastly, is this control available as a standard control in .NET or in Q...

Which is a better Option? - Local variables or store variables in Viewstate for a Webcontrol

Which option is better from Best practices point of view and from performance point of view? ...

Prevent double entries in ListView using C#?

How can we access the items added to a ListView? The thing I have to do is: add an item to the list view. I want to check if the item to add to the listview is already present in the ListView. I'm using C# and Visual Studio 2005. ...

How can I continuously QueueUserWorkItems but without queuing them all at once?

I'm working on a multi-threaded scraper for a website and as per a different question I've decided to use the ThreadPool with QueueUserWorkItem(). How can I continually Queue work items without queuing them all at once? I need to queue > 300k items (one for each userID) and if I loop to queue them all I'll run out of memory. So, what ...

In LINQ, what is the main difference/usefulness between .Any<> and .Where<>

For example, if I had a Linq to SQL data context, or if I had ADO.NET Entity Framework entities that mapped to a database table, and I want to select a single Customer... What is the difference between: MyDatabaseContext.Customers.Any(c => c.CustomerId == 3) and MyDatabaseContext.Customers.Where(c => c.CustomerId == 3) Are both e...

Is there a workaround for generic type constraint of "special class" Enum in C# 3.0?

Update: See the bottom of this question for a C# workaround. Hi there, Consider the following extension method: public static bool HasFlags<T>(this T value, T flags) where T : System.Enum { // ... } This will, as you may know, throw an error at compile-time, since a class is not normally allowed to inherit from System.En...

Service is not accessible using netTcpBinding?

This is the configuration file while hosting the service, here i hosted service using ip 127.0.0.1:36345, here service is not accessible using netTcpBinding when i hosted the using the exact ip of server (192.168.1.47:36345) it works.. what could be possible reason and solution? <services> <service behaviorConfiguration="metadata...

How can I access settings from a referenced assembly ?

I have some values (basically constants) defined in assembly (class library) A. I would like to use these settings in assembly B. Is there a way to do this other than having the assembly A have some sort of wrapper classes around these settings or not ? ...

Wpf Prism application architechture with the MVVM pattern

I'm currently introducing Prism to a new Wpf application, and am using the MVVM pattern. My initial approach of structuring the Wpf application was to add one project to hold the model classes, one to hold the viewmodel classes, etc. These might be split at a later time to avoid having different logical components in the same project. Ho...

System.Diagnostics.Process.Start Issue

Hi, I seem to have a weird issue with the System.Diagnostics.Process.Start method. I have a C# Desktop application using 3.5 SP1 .NET Framework. A user clicks on a label which passes a folder path stored in it's tag as a string to the function. Windows Explorer launches with the correct folder. When this tool is installed on Citrix a...