dotnet / dotnet/fsharp

C# project referencing F# project, intellisense doesn't detect changes until manual build

Open
#4,415 8 comments 1 reaction 0 assignees View on GitHub
Area-LangService-Diagnostics Feature Improvement
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

A full F# project (Console Application + F# Library) has no problems propagating changes so that they're visible in intellisense without executing a manual build after changes. Neither VS 2015 (with or without power tools) or VS 2017 seem to support seeing intellisense changes in a C# project referencing an F# project without doing a manual build.

**Reproduction:**

1. Create a new C# (.NET Framework) Console Application.
2. Add a new F# Library project to the solution.
3. Add a reference to the F# project from the C# project.
4. Create a union type `type Test = A | B | C` in the F# library.
5. In the C# project, create some `Test ` objects:
```
var a = Test.A;
var b = Test.B;
var c = Test.C;
```
6. Save all files and build the solution. Observe intellisense in full working conditions.
7. Remove a case from the union `type Test = A | B`. Save all files.
8. Without doing a manual build of the F# library with the changes, intellisense will never update in the C# project to reflect the changes.

**Expected:**

The F# project is building in the background (as is evident of full intellisense support of a 100% F# project with project references). It makes sense that other .NET languages should be able to see the results of the background build via intellisense. Maybe this is unreasonable because of the current state of some inner workings of VS/Intellisense, but it is definitely frustrating from a user standpoint. As someone coming from 100% C# wishing to port our back-end to F#, this has been a major pain point.

**Workaround:**

I have recently started using this extension which gives me the behavior I want on save:
https://marketplace.visualstudio.com/items?itemName=pragmatrix.BuildOnSave

I was a little worried that it would be extremely slow on a full blown solution with WPF + Xamarin (Android/iOS) + libraries + NuGet, but it hasn't proven to be much of an issue so far.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.