VS2008 to VS2010 project conversion - visual-studio-2010

I have a component project build in VS2008 and targeting the .NET Framework 3.5. I recently downloaded the VS2010 Beta 1 to make sure this project would convert over correctly when the time comes to switch to the new IDE. This project contains references to a couple of 3rd party dlls built against version 2.0 of the framework. I changed my project to build against the 4.0 version of the framework but when I try to build the project I get a ton of errors that looks like the compiler can't recognize the class types of those 3rd party libraries similar to what is below.
"The type or namespace name 'Data' does not exist in the namespace 'Microsoft.Practices.EnterpriseLibrary' (are you missing an assembly reference?)"
I'm trying to figure out why I can't compile. From what I have read .NET 4.0 uses a different version of the CLR. How or why would that impact my ability to have access to those types? Am I going to have to
a) Get the source code and recompile in VS2010 / .NET 4.0 and then reference that assembly or
b) Wait for project authors to do "a" above and release their assemblies targeting the 4.0 CLR? or
c) Something else because perhaps my VS2010 install is borked?
I can change the project properties to target 3.5 and everything works as I expect under the 2010 IDE.

I suspect this is because .NET 4.0 uses CLR 4.0, not 2.0. EL 4.1 will have been built against CLR 2.0, so I'm not sure I'd expect it to be found without help.

Seems like a CLR versioning issue to me.
For the current time, I will recommend b) and/or just compile to v2.0/v3.5.
Any specific feature that you want to use in v4.0?

I wanted to mark this question as answered and based on the comments and my own experiences, I think that Mehrdad is correct in the comment attached to the question and that it was a VS2010 project conversion problem.

Related

Is TPL DataFlow included with either .NET 4.5 or .NET 4.5.1?

I'm confused. We upgraded our project recently to .NET 4.5.1. We installed .NET 4.5.1 on our servers.
I'm referencing assembly System.Threading.Tasks.Dataflow from the GAC at C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Threading.Tasks.Dataflow\v4.0_4.5.9.0__b03f5f7f11d50a3a\System.Threading.Tasks.Dataflow.dll
CopyLocal is set to false as (I assume) it's part of the Framework, so should be already installed wherever the app is deployed.
The trouble is, when running on the server, it says it can't find this assembly.
I've read here that is is part of .NET Framework 4.5:
but the library is now built-in with .NET 4.5.
...and I've read here that it isn't!
The TPL Dataflow Library (System.Threading.Tasks.Dataflow namespace) is not distributed with the .NET Framework 4.5
What gives? It doesn't look like it is. Is it just part of the 'targetting pack'? Is it me, or are these in-place upgrades more agro than they're worth?!
I'm not sure why that page says it is part of .NET 4.5 -- it's still an out-of-band NuGet release, like Entity Framework, MVC, etc.
I recognize this question is pretty old, but I wanted to add my solution as well. I found adding the below two items to the Visual Studio 2019 install (run Visual Studio Installer > Modify > .Net Desktop Development) the problem went away and it was able to pull System.Threading.Tasks.Dataflow from the GAC.
Edit: Installing Visual Studio 2015 also seemed to be required. Obviously it isn't VS 2015 itself, just something it comes with. But there are too many packages for me to figure out which one easily.
Edit2: This isn't really the best solution, more of a stopgap. MS suggests downloading it through Nuget. https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.dataflow?view=netcore-3.1
The TPL Dataflow Library (the System.Threading.Tasks.Dataflow namespace) is not distributed with .NET. To install the System.Threading.Tasks.Dataflow namespace in Visual Studio, open your project, choose Manage NuGet Packages from the Project menu...

Using FSharpx (from NuGet) with F# 2.0 in VS2010

So I'm developing a small F# console app in VS2010, targeting .Net 3.5. Seeing as there are some nice helpers I tried to add a reference to Fsharpx.Core through NuGet.
It compiled with a warning:
Found conflicts between different versions of the same dependent assembly.
...and when executing I got the following:
Could not load file or assembly 'FSharp.Core, Version=2.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Now, I don't think I have F# 3.0 installed. Does FSharpx require F# 3.0? If so, does that mean I can't use FSharpx in VS2010? (Since F# 3.0 can't be used in VS2010.)
In that case, is there a version of FSharpx for F# 2.0? Or am I missing something?
Edit: More info on F# library versions:
Correct version of Fsharp.Core and F# compiler and runtime version number confusion.
In the end I ended up doing a F# 2.0-targeting build of Fsharpx.Core myself.
This is what i did:
Fetch latest source from GitHub.
Open FSharpx.Core.fsproj, creating a new solution for only this one.
Change references to use old version (2.0.0.0) of FSharp.Core
Build!
And this worked, solving my problems above.
Could this be working because the FSharpx source helpfully includes a F# 3.0-compiler?
Kind of like how you can use some new features in C# (like optional arguments) but still target .NET 3.5, by using a newer (from .NET 4) compiler?

Visual Studio 2010 1 Class Library Project Compile 2 DLLs (.NET 3.5 and .NET 4.0)

I have a Visual Studio 2010 Solution with a class library project. What I want to do is compile 2 DLLs on build. I want to compile against .NET 3.5 and .NET 4.0 respectively. Something like below.
myproject\bin\debug\3.5\assembly.dll
myproject\bin\debug\4.0\assembly.dll
Is this possible?
Maybe you'can write a simple problem to execute on each build, it simply does:
make a copy of your working project file (*.csproj, *.vbproj, etc.)
edit the target info from 4.0 to 3.5 (or from 3.5 to 4.0) and update other related properties, it should be simple enough.
call msbuild.
I've used this approach before for different purpose.
The target framework is part of the application project settings that cannot depend on the configuration (unlike build settings).
I'm afraid you will have to create a separate project for each framework version.

Class library set to .NET 2.0 is building to .NET 4.0

I have a web solution that contains 5 class libraries and one asp.net web site project. It's an e-commerce solution that is compiled for .NET 3.5 (some class libraries are set to .NET 2).
When I got VS 2010 installed I decided to give a try and upgrading it to .NET 4 but that didn't go so well, can't remember why. I reverted the source code control, cleared all local files, re-downloaded from source control and went back to VS 2008.
I decided to give it another try with VS 2010 due to some issues with VS 2008 but when I build the solution it fails because one of the class libraries is compiling to .NET 4. I checked the project settings and it is set to .NET 2. I have tried doing a clean on the solution, that makes no difference, the project always builds the assembly to .net framework 4.x.
I imagine something is getting cached on the system, i.e. msbuild, etc. Does anyone know where to clear this cache so that whatever is holding my class library hostage to .net 4 can actually let it completely recompile and pick up the project settings again?
Thank you.
This was a problem in the project file having the Tools attribute set which just needed to be cleared for .NET 4 compilation.

IronRuby references conflict with System.Linq?

Using Visual Studio 2010, when I add the four IronRuby references to an existing project that uses Linq in several methods, the project won't compile due to not being able to find System.Linq all of a sudden. Does the IronRuby/.Net 4.0 Framework change the location of Linq or am I missing something?
Thanks,
Becky
Are you using the build for .NET 4.0?
The 3.0 build does have those overrides but they should be included in .NET 4.0.
http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33305

Resources