BCL.Async issue with F# project - f#

Using the latest VS2013, if I create a clean console application and add a nuget reference to BCL.Async, all colouration in VS dies. You then get: -
"Internal language services have encountered severe errors. Syntax coloring or other features may stop working. If you experience such issues, they could be fixed as follows: (1) Clean current solution (2) Restart Visual Studio (.."
Needless to say neither works.

The bug is repro-ed when the project targets .NET 4.0 but not when it targets .NET 4.5.
To be clear, the error message originates from Visual F# Power Tools (see https://github.com/fsprojects/VisualFSharpPowerTools/blob/bc76dc272cb941fdbc04e2a0d203a685c5d3bc84/src/FSharpVSPowerTools.Logic/Resource.fs#L55). What happened is that FSharp.Compiler.Service chokes on newly-added assemblies and throws exceptions to upper layers.
When I installed Microsoft.BCL.Async from NuGet package console, there are some installation errors. So I had to manually add references to System.Data, System.ServiceModel and System.ServiceModel.Discovery so that the project can be compiled. When the project is compilable, colorization goes back in normal.
That said, the error message could be improved to avoid being so horrifying though.

Related

ReflectionOnly loading is not supported on this platform.F# Compiler(3053) on VSC After Installing RProvider

I installed RProvider 1.1.22 on Visual Studio and it worked with dotnetcore 3.1 and R 3.4.4. I tried to do the same thing using Visual Studio Code, but after installing RProvider I get this error "the type provider 'RProvider.RProvider' reported an error: The type provider constructor has thrown an exception: ReflectionOnly loading is not supported on this platform.F# Compiler(3053)"
Does anyone know what causes this error and its fix? If not, I would appreciate explaining the meaning of "Reflection Only loading". I tried searching it on the web but with no luck.
Update: RProvider worked with me on visual studio even with .Net 5. However, as #CaringDev mentioned, there seems to be a problem with the new dotnet build. It will only build through MSBuild.exe.
Assembly.ReflectionOnlyLoad is not supported on NET 5.0. If you want to use RProvider in VS Code you will have to target netcore3.1.
It seems RProvider does not work with new SDK-style projects. The message containing ReflectionOnly loading is mentioned in a PR
Given that the RProvider project is not actively maintained, I fear you are on your own.

TFS Build Failing on System.Windows

I've been trying to run my build on TFS and I keep getting an error that kills my build. What's strange is that nothing except code change has been done since the issue started (Or at least that I'm aware about). I keep seeing this:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.WinFx.targets (268): Unknown build error, 'Cannot resolve dependency to assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.'
I've googled this and the only thing I see is that it's because there's a Silverlight dll being used in a WPF application. My application is a WPF project, but I haven't been able to find any changes being done in any of my projects in my solution in regards to references.
For more information, this project is a branch from the main code. The main development branch runs fine, but for some reason, this build just fails.
Any ideas?
It seems like you're referencing the Silverlight version of System.Windows instead of the .NET Framework version. Have you tried installing Silverlight on the build server or changing the reference of your project to point to the normal .NET Framework version of that assembly (which .NET Framework exists on your build server)?

Bad day fixing references in mvc 5.1 app

I have a problem with visual studio and nuget package manger
I was running very good when suddenly the project stopped to compile telling me that the ApplicationDbContext should derive from DbContext or something like that, i couldn't see the problem so i cleaned my solution rebuilt the project it compiled but had stupid runtime erros so I searched stackoverflow and the web And I found out it was a reference error in the first place so I removed the bin folder as described here in this question
higher version than the referenced assembly
then it went all bad i tried to remove all the references and re-install them manually but nuget PMC kept telling me that my project already had a reference to that assembly,, I closed Visual Studio re-cleaned the project and done that once again with no results!
so the question here would be how to re-install the latest version of everything to be compatible with asp.net MVC 5.1 without getting a message telling me that my project has a reference to those assemblies nonsense !
I had this happen to every one of my projects I upgraded to MVC 5.1. I had to add binding-redirects to my web.config. With the Package Manager Console it was easy.
http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference#Add-BindingRedirect

Problem with F# Powerpack. Method not found error

I've had F# Powerpack for a while now. It ran perfectly. But a few days before, I don't know what I did, whenever I compile my project and run it, I get an error
Method not found: 'System.Object Microsoft.FSharp.Text.Parsing.Tables`1.Interpret(Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Text.Lexing.LexBuffer`1<Char>,!0>, Microsoft.FSharp.Text.Lexing.LexBuffer`1<Char>, Int32)'.
I tried on my laptop too. Then I thought, that it might be an error in my code. So I started a new project, F# Parsed Language Starter Kit (the starter kit you find online), and it fails with the same error. I tried reinstalling F# Powerpack but the error continues.
You've probably installed VS2010 SP1.
http://fsharpnews.blogspot.com/2011/03/dont-install-vs2010-sp1.html
Please send details of your install configuration and updates to fsbugs AT microsoft.com.
Also, please repair Visual Studio, and/or look at the instructions on this page and send us the contents of your pub.config file.
A workaround to get you going again is to recompile the F# Power Pack for .NET 4.0 (it is a .NET 2.0 binary, and this related to the issue you're seeing)
I've got the same error when trying to build WikiBooks Lexing/Parsing example in Visual Studio 2012. I resolved the problem by switching target framework from 4.0 to 4.5 in project settings.

CruiseControl.NET, VS 2010 and MVC 3 -- build error

Using the latest stable of CC.NET (new to it) and VS 2010.
I have defined project files for simple C# projects (4 in total) and one MVC Project.
The C# projects all compile correctly; however, the MVC3 project refuses to build.
I receive the following error in CC.NET:
error MSB4019: The imported project
"C:\Program
Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets"
was not found. Confirm that the path
in the declaration is
correct, and that the file exists on
disk.
After searching around and finding This link
and This other link (both referring to older versions of Visual Studio), it seemed that the general solution was to copy these files from that directory to the solution directory, add them to the solution with visual studio, and then change this line in the .csproj file:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
To this:
<Import Project="$(SolutionDir)\Microsoft.WebApplication.targets" />
However, this technique that worked for other VS Versions produces a different result in VS 2010: I receive the .NET Project upgrade wizard, as if upgrading the project from an old version of .NET. This strangeness is compounded by the fact that even if I do an undo and re-save the file exactly as it was, I receive the same message. It's as if the project has been marked dirty or something else has changed somehow.
Anyone have any ideas? This seems like it should be easier, but I can't seem to find another resource on it anywhere. Hoping StackOverflow will come through per usual. :)
Thanks in advance for any help!
The .targets file for v10.0 also has an assembly in the install folder - Microsoft.WebApplication.Build.Tasks.dll. Did you copy that file over as well? That will likely be necessary for the .targets file to work correctly, though that may not be the cause of your problem.
It sounds like CC.Net isn't getting a proper reference to the msbuild executables.
Trying installing both of these on your build server (that's who I was able to get past that exact error).
Links :
Windows SDK .Net 4
VS2010 Integrated Shell

Resources