.net-4.0

How to catch 'exceptions' for out of order execution in Workflow Foundation 4?

Hi, I am attempting to model a worklfow using a "WCF Workflow Service" in .net / vs 2010 that needs to handle out of order execution gracefully (but not allow it - if thath makes sense!?) For example I have 2 receive activities one called Initialize and the other called GetValue inside a FlowChart. In most cases Initialize should be c...

What is the compatibility on .NET 4.0?

We have several .NET applications developed in .NET 3.5 (Windows services, web applications, and WCF services) in different servers. I'd like to migrate to .NET 4.0 and use VS.NET 2010. Does VS.NET 2010 compiles to .NET 3.5 to avoid full simultaneous migration, being able to stop using VS.NET 2008 but maintaining some applications in ...

.net 3.5 to 4.0 Migration

Currently we are doing a payroll application in Microsoft Visual Studio 2008 (.Net 3.5) using some of the latest features like WCF, WF and the development for the same has almost completed. However, clients have shown their interest in migrating the developed payroll application in Microsoft Visual Studio 2008 (.Net 3.5) to Microsoft V...

Calculating the square of BigInteger

Hi, I'm using .NET 4's System.Numerics.BigInteger structure. I need to calculate the square (x2) of very large numbers - millions of decimal digits. If x is a BigInteger, What is the time complexity of: x*x; or BigInteger.Pow(x,2); ? How can multiply such big numbers in the fastest way using .NET 4 BigInteger? Is there an imple...

Visual Studio 2010 debug minidump

Hi all, Consider the following code (written with Visual Studio 2010 and .NET 4.0) using System; namespace DumpTester { class Program { static void Main(string[] args) { int test = new Random().Next(); Console.WriteLine(test + new Random().Next()); Test(); } private static void Test() { throw new Exceptio...

.net 2.0 accessing .net 4.0 dll via assembly bindings

Hi, I have a .net 2.0 webservices using .net 2.0 librarys (dll). My config uses assembly binding to use the latest builds,Now the .net2.0 will be migrated to .net 4.0, does this mean i have to move my service to 4.0 as well? Thanks Gauls ...

Unit tests and Test Runner problems under .Net 4.0

Hi there, We're trying to migrate a .Net 3.5 solution into .Net 4.0, but are experiencing complications with the testing frameworks that can operate using an assembly that is built using version 4.0 of the .Net Framework. Previously, we used NUnit 2.4.3.0 and NCover 1.5.8.0 within our NAnt scripts, but NUnit 2.4.3.0 doesn't like .Net 4...

Slow performance of System.Math library in .NET4/VS2010

My application compiled in .NET 4 seems to be performing really slow compared to .NET 3.5. When I did the performance analysis, I found out that the System.Math libraries in VS2010/.NET 4 have slowed down considerably. Any explanation to this? Has anyone else come across this or am I the only one seeing this? UPDATE: My sample code l...

Why choose .Net 4.0 over previous versions?

Possible Duplicate: New Cool Features of C# 4.0 What are the major advantages of using .Net 4.0 over prior versions of the framework? ...

BlockingCollection class: Does thread yield if Take blocks?

MSDN said that BlockingCollection.Take call blocks if there is no elements in it. Does it mean the thread will yield the timeslice and go to the waiting threads queue? If yes does it mean that the thread will change its state to Ready once the blocking collection received an item and then will be scheduled to next timeslice as per usual...

How can I disable the Menu control from styling itself in javascript?

I'm using Visual Studio 2010 and ASP.NET 4.0 to render a Menu control as an HTML list so I can style it using CSS. Here is the code I am using below <asp:Menu ID="navlist" runat="server" Orientation="Horizontal" SkipLinkText="" ClientIDMode="Static" DataSourceID="MenuSource" MaximumDynamicDisplayLevels="0" IncludeStyleBlock="False" S...

How to run .NET 4 code analysis on build server

On a Windows Server 2003 R2 with .NET 4 SDK but without Visual Studio 2010, I have tried building a Visual Studio 2010 solution with msbuild MySolution.sln /p:RunCodeAnalysis=true but that fails. What is required to run code analysis on such an environment? I get this error message: C:\Program Files (x86)\MSBuild\Microsoft\Visual...

How do I make TcpClient stop in a thread?

I've a thread that runs following tcpConnect method. I wish to stop it at any given time by setting Program.PrepareExit to true. However my program is stuck at: Int32 bytes = stream.Read(data, 0, data.Length); and doesn't really react to Program.PrepareExit set to true. How can i make it to always quit when I tell it so? public stat...

Will .net 4.0 runtime work with SQL Server 2000?

According to this article, Visual Studio 2010 no longer supports SQL Server 2000. However, it's a bit less clear on whether the runtime (and things like ASP.net 4.0, Linq2SQL and EF) will work with it. It seems that only the design-time features require SQL Server 2005 or greater according to that article. I have a project that requir...

C# How to maximize chance that particular section of code will have no context switch?

I have time-critical piece of code in my app. I made the thread which runs it Highest priority - that's the most I could do. Is there any suggestions on how to make part of the code run in this thread to be interrupted as few times as possible (less context switch occurred) ? The code is not complicated. I replaced all the method calls...

How to simulate closing of BaloonTip?

I have a NotifyIcon which shows Baloon Tips with some information. Is there a way to send some command to close this BaloonTip depending on my choice from within code (and not by using mouse)? a) Click BaloonTip (normally by clicking anywhere within the TrayTip) b) Close BaloonTip (normally by pressing X in TrayTip window). ...

Is there simple and conscious diagram / algorithm on threads scheduling?

I have soft real-time .NET application run on W2008R2. I just realised that I cant explain how precisely threads are being scheduled. And for my embarassement I dont know how it works down to OS threads at all. So I will explain what I know and I'd appreciate if anyone could help me to fill the gaps and refer me to a simple descripti...

C# When a managed thread ends its time-slice will it incur context switch?

In Russinovich book it says that thread (NOTE: this is about OS thread) will need dispatching (scheduling) if it a) became ready b) ended its timeslice, yields or blocks. I have a managed thread in my C# real-time app for which is very important to achieve as fewer context switches as possible. This thread has Highest priority and the ...

dotnet Framework 4 missing from visual studio 2010

I just installed visual studio 2010 but when i create a new project Framework 4 does not appear in the options for target framework. I know framework 4 installed correctly because the new app pools set to v4 were created in IIS. For some reason it's just not showing up in visual studio. I tried repairing dotnet 4 and reinstalling visual ...

How to create object with multiple values?

I'm creating XML file which will hold couple of values regarding TCP Connection (IP (string), PORT (int), RetryCount (int), StartAutomatically (bool) and so on. There will be a number of TcpConnections defined like that (unknown to me). What i thought is to create some kind of object called TcpConnectionHolder which i could create dyna...