F# Weekly #49, 2015

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos/Presentations

Blogs

F# vNext News 

Open source projects

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #48Subscribe

How to restore Visual Studio 2015 after the Update 1 (dependency dance)

Update 12/11/2015: Two issues were opened as a result of investigation “Installing the fsharp power tools before installing adding VS2015 update 1 breaks Roslyn” in Visual F# Power Tools repository and “We read some settings from the devenv.exe.config file — devenv.exe.config is not user mutable” in Visual F# repository.

This post is prepared especially to save F# Advent Calendar in English 2015 schedule.

Short version of the fix posted on Stack Overflow.

Note: Described fix is not permanent, VS may reset your changes in devenv.exe.config file after the new extensions install/update.

Yesterday Microsoft released the first update to Visual Studio 2015 that contains some pretty cool features and improvements, but this update has broken “some” machines.

During the first run after the update, you may see errors like this one:

VSexception

or even NullReferenceException when you try to open the list of installed extensions

In order to fix all this stuff you need to check ActivityLog.xml file (c:\Users\{user_name}\AppData\Roaming\Microsoft\VisualStudio\14.0\) and find the exact error message. Most probably, you will see something like this

SetSite failed for package [CSharpPackage][Could not load file or assembly ‘System.Collections.Immutable, Version=1.1.36.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]:{ at Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService.AbstractPackage`2.Initialize() at Microsoft.VisualStudio.LanguageServices.CSharp.LanguageService.CSharpPackage.Initialize() at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)}

This error says that bindingRedirect set up incorrectly for VS process. You need to find file devenv.exe.config in c:\Users\{user_name}\AppData\Local\Microsoft\VisualStudio\14.0\ and update it. (Or c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\, depending of location of your devenv.exe file).

For this particular case, you should find rows that setup redirects for System.Collections.Immutable and change newVersion from 1.1.36.0 to 1.1.37.0. Final config should look like this

<dependentAssembly>
  <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
  <bindingRedirect oldVersion="1.0.27.0-1.1.65535.65535" newVersion="1.1.37.0"/>
</dependentAssembly>

After this fix, I was able to load my IDE and setup latest version of Azure SDK 2.8.1 that reset my changes in .config file and I needed to fix it once again.

Everything was OK, until I have tried to open my web project. This time it crashed with the following error in ActiveLog.xml:

SetSite failed for package [JavaScriptWebExtensionsPackage][Could not load file or assembly 'Microsoft.VisualStudio.ProjectSystem.V14Only, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]:{   at Microsoft.VisualStudio.Html.Package.Utilities.ProjectUtilities.IsImmersiveProject(IVsHierarchy hierarchy)   at Microsoft.VisualStudio.Html.Package.Project.WebProjectServices.IsWebProject(IVsHierarchy hierarchy)   at Microsoft.VisualStudio.Html.Package.Project.WebProjectServices.AdviseProject(IVsHierarchy hierarchy)   at Microsoft.VisualStudio.Html.Package.Project.WebProjectServices.AdviseOpenedProjects(IVsSolution solution)   at Microsoft.VisualStudio.Html.Package.Project.WebProjectServices.HookGlobalEvents()   at Microsoft.VisualStudio.Html.Package.Project.WebProjectServices.Microsoft.VisualStudio.Html.Package.Project.IWebProjectServices.get_OpenedProjects()   at Microsoft.VisualStudio.JavaScript.Web.Extensions.ReferenceAutoSync.ProjectServices.Initialize()   at Microsoft.VisualStudio.JavaScript.Web.Extensions.ReferenceAutoSync.ProjectServices..ctor()   at Microsoft.VisualStudio.JavaScript.Web.Extensions.JavaScriptWebExtensionsPackage.Initialize()   at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)}

After the search on C:\ drive for Microsoft.VisualStudio.ProjectSystem.V14Only.dll I realized that my machine has version 14.1.0.0 instead of 14.0.0.0. So it looks like we need to add one more redirect in devenv.exe.config.

<dependentAssembly>
  <assemblyIdentity name="Microsoft.VisualStudio.ProjectSystem.V14Only" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
  <bindingRedirect oldVersion="14.0.0.0" newVersion="14.1.0.0"/>
</dependentAssembly>

After these fixes, I have not seen any other errors on my machine (at least for now). I hope that you understand the core idea on how to troubleshoot and fix such errors. So good luck to you and VS team with dependency fighting.

P.S. One more useful advice that can save you time – try to clear Component Model Cache if things start going wrong.

F# Weekly #48, 2015

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos/Presentations

Blogs

F# vNext News 

Open source projects

  • SuaveAzureCloudService – Example project illustrating how to host Suave in an Azure Cloud Service.
  • Liquid – The Language-Integrated Quantum Operations (LIQUi|>) simulator
  • Hutton – F# implementation of Graham Hutton’s parser combinator library from chapter 8 of his book Programming in Haskell
  • Countdown – F# countdown problem implementation of chapter 11 of Graham Hutton’s book Programming in Haskell
  • diamondfscheck – The Diamond kata done with Property-Based Testing in F#
  • SentimentAnalysisDemo – Talk on sentiment analysis of tweets using F#
  • OctoProv – A very, very incomplete type provider for Octopus Deploy
  • FCor – F# Numerical Library
  • Persimmon.Dried – Random testing for Persimmon

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #47Subscribe

F# Weekly #47, 2015

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos/Presentations

Blogs

F# vNext News 

Open source projects

  • freya – functional-first web stack, including an HTTP finite state machine, built on top of OWIN
  • Exira.SimpleHttpServer – a simple HTTP server to serve static files
  • Exira.StaticMailer – a REST endpoint running in a Windows Service to enable static sites to easily send mail.
  • fscontrol – An F# base library with standard ad-hoc polymorphic functions over primitive types
  • mitls-fstar – TLS implemented in F*
  • telefone – Telegram bot library in F#
  • Fun Basic
  • vim-fsharp – F# bindings for vim
  • MBrace.AWS – MBrace runtime implementation targeting Amazon Web Services

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #46Subscribe

Simple Web API OWIN host using F#

Very nice starter pack for OWIN Web API with F#. If you use Paket manager you need only one dependency to `Microsoft.AspNet.WebApi.OwinSelfHost` NuGet package

Also Web API can be easily configured to use Swagger UI.

Kevin Holditch's avatarException Caught

I thought it would be good to write a simple OWIN Web Api host using F# to show how easy it is to interop between the two languages and as a fun experiment. You can find all of the source code from this blog post at the FSharpWebApi github repository.

If you open the Program.fs solution in the github repository you will see the following two lines of code are reponsible for starting the web server:

The getAppBuilder function is defined in the WebServerBuilder module as follows:

The getAppBuilder function returns a function with the signature (IAppBuilder) -> (). This signature is the same as the one expected by the first parameter of WebApp.Start. The reason for breaking this function off into its own module is so that it can be tested.

The cool thing about the Web Api Owin Self host stack is that there is a nuget…

View original post 491 more words

F# Weekly #46, 2015

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos/Presentations

Blogs

F# vNext News 

Open source projects

  • soma – F# Sql Oriented MApping framework
  • Exira.Route53Updater – a console application which updates a Route 53 record with the current EC2 hostname
  • ges-runner – Exira.EventStore.Runner is a wrapper that uses Topshelf to run EventStore as a Windows Service
  • fsharp.interop.dynamic – portable class library dynamic operator using the DLR
  • ionide-fsharp – Set of Atom plugins for F# development
  • TraktorAutoNextSong – A small tool for automatically finding next song to play when DJing using TraktorPro2
  • FSharp.Automaton – port of automaton
  • modelmod – A system for modifying art in games
  • codesize – Code size visualization tool with PDB/ELF/Mach-O support
  • argu – A declarative CLI argument/XML configuration parser for F#
  • visualfsharpdocs – Visual F# Tools documentation repo

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #45Subscribe

F# Weekly #45, 2015

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos/Presentations

Blogs

F# vNext News 

Open source projects

  • zerotonine – a tool for maintaining .NET Assembly versions across multiple files
  • fpworks – repository hosting the open-source Nu Game Engine and related project
  • prajna – a distributed functional programming platform for interactive big data analytics and cloud service building
  • RouteProvider – a type provider for web routing
  • exchange2crm – Sync.Today Lite for Microsoft Exchange and Microsoft Dynamics CRM: Import Office 365 Exchange Contact to Microsoft Dynamics CRM
  • Hopac – a Concurrent ML style concurrent programming library for F#
  • FSharp.NeuralNetwork – a simple neural network framework for F#
  • SketchBot – a robot of sorts to drive an Etch-a-sketch
  • ArithmeticEvaluation – very nice example of using F# fslex and fsyacc
  • cantos – F#st and furious static website generator
  • clonalanalysis – Bayesian estimation of parameter likelihood for a simple model of clonal development
  • MicroCS – Micro C# Compiler
  • visualfsharp-docker – Visual F# on CoreCLR
  • fsautocomplete – F# compiler service API exposed via a console application
  • FsMachines – a stream processing library for F#

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #44Subscribe

F# Weekly #44, 2015

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos/Presentations

Blogs

F# vNext News 

Open source projects

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #43Subscribe

Anniversary edition of F# Weekly #43, 2015 – Three years together

3years

Welcome to F# Weekly,

This is an anniversary edition of F# Weekly, we are together for 3 years already! Just wow! It was an amazing time, a lot of things changed in the F# world during this period, but one thing stays the same – you still read F# Weekly every week, thank you for that!

In order to celebrate this date, I ask you to join “F# Advent Calendar in English 2015” and make this December unbelievably cool!

FsAdvent

A roundup of F# content from this past week:

News

Videos/Presentations

Blogs

F# vNext News 

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #42Subscribe