Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8218313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:45:06+00:00 2026-06-07T12:45:06+00:00

I have a .NET application using .NET Framework 3.5, written in C#. The application

  • 0

I have a .NET application using .NET Framework 3.5, written in C#. The application is invoking delegates asynchronously using BeginInvoke. The application works fine when compiled using Visual Studio 2012 RC, but it freezes when compiled with Visual Studio 2010 SP1 (the main thread is stuck in WaitOne waiting for async delegates to complete, but they never execute).

While it is possible the bug is in wrongly designed synchronization, what I am surprised is why it works in VS 2012 and does not work in VS 2010, while I am targeting the same framework version in both.

How is multi-targeting implemented in Visual Studio for .NET? Should one expect the executable behaviour to be identical when targeting the same framework version, or is there some part (compiler front end or some part of runtime libraries), which depends on the Visual Studio version used?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T12:45:08+00:00Added an answer on June 7, 2026 at 12:45 pm

    Yes, there is a difference. The C# compiler used is different. See VS2008 targeting .NET 2.0 doesn't stop me from using C# 3 features. Note: This is different from how multi-targeting works with Visual C++, where the complete tool chain is used from old versions when targeting them.

    The issue which hit me was a different lifetime scope for foreach variable. I was capturing the variable in a delegate, and while in VS 2012 each delegate captured its own version of the variable, in VS 2010 it did not.

    VS 2012 is using C# 5 compiler, which implements the new behaviour. The change is documented in Visual C# Breaking Changes in Visual Studio 2012 RC. It is also described in What else is new in C# 5? or Lifting ForEach, Breaking Change in Visual Studio 2012.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I create a ASP.NET Web Application (using .net framework 4) in visual studio
I have written a small application in C# using Visual Studio 2010. It is
I have written a small Asp.net application using Entity Framework. A Stored Procedure accepts
We have an application written in C#, using .NET Framework 3.0 or 3.5 or
I have a problem with a c# assembly (.net 2.0 written using Visual studio
I have asp.net application and am using Entity Framework to connect it with the
I have an ASP.NET Dynamic Data application (using Entity Framework) in which I have
I have compiled a .NET application using Any CPU option. This .NET application uses
I have a ASP.NET MVC application using NHibernate and the application runs fine when
I have single-thread windows form application written with VB.NET and targeting Framework 1.1 .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.