.net-4.0

XamlObjectWriter throws exception while writing from XamlXmlReader - .Net 4

For some reason I get an exception. Can someone please explain to me why and how can fix this? I am trying to read a DataTemplate. If there is a better option please tell. Thanks. using System; using System.Windows; using System.Windows.Data; using System.IO; using System.Xaml; using System.Xml; namespace TestApp { public partial c...

VB.Net .net 2.0 Multiple programs each running threads on xp, will vb.net 2010 be better?

In the past few weeks, to speed up our database freshening process, I've created a couple of extra programs, basically copies of the exe file. The program itself, accesses web pages, images etc and uses threads to do so. The second program uses LIMIT 300,100 and the third LIMIT 600,100, to make sure they don't work on the same records. ...

c#: better threading architecture

Hello, I am interested to get some ideas from you about what would be a good/better threading architecture that respects the rules described below: A thread must be running for the life of the application, in the sleep/wait mode if there is no work in the queue to be performed. A thread must be of a BelowNormal priority (this eliminat...

Asp.Net 4.0 CacheItemPolicy sliding expiration incorrect?

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.Caching; using Xunit; namespace Demo.Caching.Test { class MemoryCacheManagerTest { [Fact] public void Test() { CacheItemPolicy policy = new CacheItemPolicy(); policy.Sliding...

Is there an alternative to CHESS for testing programs written with Task Parallel Library

I am looking for a tool that will allow me to execute unit tests over all possible interleavings (spelling?) with a program that was written with Task Parallel Library constructs. Alternatively, how could I run CHESS with dotNET 4.0? ...

Nesting Parallel Queries

Are there any issues with running nested PLINQ queries? For instance: //Contains roughly 7000+ elements mycollections.AsParallel().ForAll(x => { //contains 12 elements anothercollection.AsParallel().ForAll(y => { //download some data from the web and parse it }); }); ...

Migrating project from .NET 2.0 to .NET 4.0

Hi, I'm migrating my solutions from .NET 2.0 to .NET 4.0. I open the solution file in VS 2010 and follow migration wizard. While building the solution and comparing the changes with the server copy (since solution is under source control VSTS), I surprisingly found that 1) the public classes were changed to 'internal' and 2) the 'pu...

Information needed on how to code for Windows 7 Taskbar in c#

Hello, What i know so far about how to code for win 7 taskbar features is that i can either use .net 4 or WinAPI code pack in .net3.5 or pinvoke. My question is that can i code for win 7 task bar features using .net3.0 or prev and using pinvoke can i use features such as thumbnail toolbar, jumplist, overlay icon Thanks ...

CLR Profiler 2.0 does not work on .NET 4.0 Client Profile WPF application

Hi I have a WPF application that is targeting the .NET Framework 4.0 Client Profile. When I run it from the CLR Profiler 2.0 (which runs with administrative rights), the application starts and runs normally, but the CLR Profiler does not show any information on it. When I hit 'Show Heap Now', it freezes for some time, and then displays...

Difference in RIA services between .NET 3.5 and 4?

I am about to start a new project. Using VS2010, Silverlight 4, and RIA Services are a given. However, due to the web server we have available, there is some question of whether we can use .NET 4 or whether we will have to stick to .NET 3.5. I know that RIA Services can work with .NET 3.5. But what I'm curious about is whether there ...

How to create a hash code in C# on object graph supplied by a WCF service.

I currently have a WCF service which provides an object graph of data on request. I want to have a mechanism where the client can compute a hash on the cached object graph it posses and can then supply this hash value to the WCF service to see if it matches the data the service possesses. I tried this using a standard cryptographic algo...

Require an old version of silverlight

We're using a combination of Silverlight 4, .net 4 and VS2010 for several internal projects. When building a project, we're not manually specifying the build of silverlight that we require anywhere other than in the page that gets auto-generated. We're having problems with the clients requiring the absolute latest build of silverlight t...

Matching everything except a specified regex

I have a huge file, and I want to blow away everything in the file except for what matches my regex. I know I can get matches and just extract those, but I want to keep my file and get rid of everything else. Here's my regex: "Id":\d+ How do I say "Match everything except "Id":\d+". Something along the lines of !("Id":\d+) (pseudo...

SSIS 2005 and .NET 4 Framework

Is it possible to access .NET 4 Framework references using BIDS 2005? Specifically to trigger a WorkFlow. I have a dll built in VS2010 using the .NET 4.0 and would like to access the methods/fields in it. in VS2010 I would be able to Import System.Activities and use WorkFlowInvoker.Invoke I need to be able to do this in BIDS 2005 usi...

How to customize registration page for silverlight business application?

When you create a silverlight 4 business application, using VS2010, by default you will get a login and registration page. I need to customize the registration page, to add more fields. How do I do that? Thanks in advance. ...

Which one is better? "var" or "DataType"?

Hi In C# 4, which one is better or maybe faster for declaring a variable? var ds = new Class1(); OR Class1 ds = new Class1(); I myself believe that second one should be faster coz compiler doesn't need to look for the type Class1, but some addins like ReSharper always notify me to change Class1 to var. Can anyone explain me why? ...

How to create a resuable structure in ASP.NET 4.0 (C#)

Hello, I am looking at how I structure my projects in ASP.NET (web applications). Most websites will have the basics but each project will differ and I will need to add some extra functionality that I would like to group into applications. E.g. add a blog application. I am interested in web applications so that I may package websites...

Does VB.NET and Visual Studio 2010 support multiline anonymous method?

I found that this answer was asked and answered before VS2010 was actually released. They say that VB9 has only single-line anonymous functions. We're adding full statement and multi-line lambdas in VB10. But I tried to add this code Dim test2 = Function(t1 As T, t2 As T) ( Dim val1 As IComparable = DirectCast(prop.GetValu...

Retrieving parameter values using Microsoft Enterprise Library Exception Handler

We are using Enterprise Library for all our logging and exception handling needs in our app. We have added an email listener to send all the caught exceptions in email to the administrator. One requirement is that when an exception occurs in a method we need to retrieve the parameter values of the method if any and attach it to the excep...

How to create a method that suport translation to sql?

Hi, I wanted to use a method I created inside a query coz i need to implement a peculiar type of filter... return manager.Clients.SelectAll().Where(cli => cli.Name.SatisfyFilter(filter.Name) && cli.LastName.SatisfyFilter(filter.LastName) && cli.MiddleName.SatisfyFilter(filter.MiddleName)).ToList(); But i get the: "Method 'Boolean Sa...