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?
Related
I'm getting confusing with the pletora of assemblies that I get from nuget related to Roslyn. I have last version of xamarin with .NET 4.5 profile. I wish to use the scripting part of Roslyn. But don't found how setup the project.
What si the package from nuget I need to download? Is my impression, but the names of the namespaces have changed? Because the tutorial I have found using C# not match what I have get from nuget
With the last version of Visual Studio for Mac, I can finally create .NET Standard Library and reference the Microsoft.CodeAnalysis NUGET packages.
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...
I have a project written for Silverlight 5, which references Silverlight's System.Windows assembly in version 5.0.5.
Now I want to create a unit test project for it using a usual .NET 4.5 library project. When I try to add a reference to the System.Windows assembly 5.0.5 from Silverlight (using the browse dialog), Visual Studio adds the version from .NET 4.5.
Hence the version number does not match.
Why does Visual Studio behave this way?
How do I fix this?
You can reference Silverlight assemblies from a .Net project, but once you have managed to add one, you will likely have problems with dependencies on other libraries.
It will be easier on you if you to try a different approach...
I would suggest using the Silverlight Unit Test Framework to deal with testing your Silverlight code.
If that doesn't fit your need, perhaps Portable Class Libraries will.
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.
I've recently taken over a project, and the original developer has gone. I'm now trying to install the app on a new server, and I've got a problem with dependent assembly versions.
The project is a reporting tool, with (unfortunately) a reference to Crystal. On my machine I have version 11.5.9500.313 of CrystalDecisions.CrystalReports.Engine.dll.
The NAnt script that does the build defines the references, including the Crystal dll, but does not define the version number.
When I build the app, using the NAnt script, and analyse the assembly with Reflector, the reference is for version 11.5.3300.0.
Can anyone explain where the version number of this reference comes from?
Assembly version (from AssemblyVersionAttribute) is not necessarily the same as the file version (from AssemblyFileVersionAttribute). Unless you use a tool which returns the assembly version consistently (e.g. Reflector) comparing versions is going to be completely unreliable.
It comes from the references in the vs. project file. Open the project file in a text editor and check it out. Anyway, to fix re-add the references in the visual studio.