You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[design-time only] Assembly reference was not found or is invalid #3221
I have this and #3054 (comment) in a base-lib which depends on 5 other projects. If I remove everything except these five projects from the solution, then the error stops happening, even though there should be no change from the view of these projects.
For me it looks like something completely unrelated in the solution fucks VS up.
The whole solution has ~60 projects, so I'm not going to try all permutations and check which of these causes this.
For now I'm dropping VS and using Rider, not because of this bug, but because of #3054 (comment), which now happens always.
Did you check if switching between "Build" and "Build + Intellisense" clears the error?
Yes and No. It is visible in the "Error List" for either "Intellisense Only" or "Build+IntelliSense", but is always visible as a red squiggle in the document at location (0,0). Switching does not affect the squiggle in the document.
My previous remark
The file exists on disk, and was built by a different (C#) project in the same solution.
is not completely true: when VS was started, the file did not yet exist (if the solution was built before opening, I hit #3222), but building the project does not clear the squiggle.
seems I have similar (same?) use with my project here: https://github.com/plainionist/Plainion.Windows revision 0af9a48.
i tried endless things of clean + rebuild, changing .net version, updating fsharp.core .... the only "workaround" which i was able to apply successfully after several reopens of VS was to unload the fsharp project again and reload it after 2-4 seconds. (i have only one fsharp project among 3 c# ones).
Closing the solution in VisualStudio (without closing VisualStudio) appears to fix the problem. You can then safely re-open the solution.
Probably the right way to fix this is to use .NET Core AssemblyLoadContext and load the entire F# toolchain inside a context, and hook any critical exceptions as a clue to unload the context and reload it. I'm not sure if DevENV supports such logic, but it seems in 2016 .NET added support for .NET Core global exception handlers. -- It's not clear how that works and how the DevENV would know "oh crap, F# died, need to reload" although maybe the "object sender" property or the EventArgs might contain clues.
@dsyme I suggest the simplest way to try to repro this problem is to load a "toxic alpha" verison of F# Plug-in into Visual Studio that crashes on any function named jzabroski (or similar). I think this will demonstrate the design-time only aspect of this bug.
I think I put together exactly what happens in my case.
I'm right - Quick Watch can cause an unhandled exception, which appears to leave the F# engine in an unknown state
I'm also right - when the engine is in an unknown state, the F# <-> C# bridge tooling seems to die, causing compile errors to appear around F# code calling c# code, especially if the c# code is a static class
Most likely. Definitely for 16.3.8 (I think) - I try not to touch the F# project as its a time sink. FWIW, These "basic compilation doesn't work smoothly" issues have only gotten worse and worse over time. It used to be the thing that would piss off my engineers is that the bootstrap of the FSharp.Core.dll and Tools from C# would cause weird nuget restore errors (my favorite was when the nuget package for the version we were using was somehow deleted). Then it precipitated into random runtime crashes while debugging.
I'm not an F# expert, but I also noticed other weird things with F# IntelliSense that I could not understand based on the documentation. In particular, sometimes the tooltip that displays type inference would change the order of the expression. Maybe that's an expected behavior, but it went away when I added type annotations.
I did some tests for you - it does seem a bit more stable. Can I ask if you have any regression tests against things like referencing a c# static (or instance) class in the same project (not a nuget package).
openCSharp.FooBarProject.Legacy.CustomEntitiesletGetRatioNonStandardlyFooBarsUpdateFun(nonStandardlyFooBars :NonStandardlyFooBar list)(clientSpecificFooBarRatios :ClientSpecificFooBarRatio list)(fooBarMetadata :CSharp.FooBarProject.Legacy.CustomEntities.FooBarMetadata)// this would cause problems, especially if referenced without fully qualified namespace+class(defaultPercent :float)(fooBarTypes :NonStandardFooBarType list)(executionContext :ExecutionContext)=
Activity
dsyme commentedon Jun 19, 2017
@0x53A We'll need a step-by-step repro for this. Does rebuilding the project succeed?
It could also be a manifestation of #3047
0x53A commentedon Jun 19, 2017
@dsyme Yeah, thats the great thing about this and #3054 (comment), it's not reproducible in a small isolated project.
Build and Rebuild work fine, but do not clear the error.
0x53A commentedon Jun 19, 2017
I have this and #3054 (comment) in a base-lib which depends on 5 other projects. If I remove everything except these five projects from the solution, then the error stops happening, even though there should be no change from the view of these projects.
For me it looks like something completely unrelated in the solution fucks VS up.
The whole solution has ~60 projects, so I'm not going to try all permutations and check which of these causes this.
For now I'm dropping VS and using Rider, not because of this bug, but because of #3054 (comment), which now happens always.
dsyme commentedon Jun 19, 2017
Did you check if switching between "Build" and "Build + Intellisense" clears the error?
Re #3054 (comment) it feels likes this should be tracked by a separate bug.
0x53A commentedon Jun 19, 2017
Yes and No. It is visible in the "Error List" for either "Intellisense Only" or "Build+IntelliSense", but is always visible as a red squiggle in the document at location (0,0). Switching does not affect the squiggle in the document.
My previous remark
is not completely true: when VS was started, the file did not yet exist (if the solution was built before opening, I hit #3222), but building the project does not clear the squiggle.
plainionist commentedon Aug 7, 2017
hi,
seems I have similar (same?) use with my project here: https://github.com/plainionist/Plainion.Windows revision 0af9a48.
i tried endless things of clean + rebuild, changing .net version, updating fsharp.core .... the only "workaround" which i was able to apply successfully after several reopens of VS was to unload the fsharp project again and reload it after 2-4 seconds. (i have only one fsharp project among 3 c# ones).
hope that helps ...
regards,
seb
dsyme commentedon Aug 8, 2017
@plainionist OK, thanks, we will try your repro
0x53A commentedon Aug 22, 2017
Now it repros reliably:
Repro steps
Solution1.zip
Note: I think you always needed to build the C# project before F# recognized it, but it should not require a reload of the solution.
Known workarounds
Build + Restart VS (or just reload the F# project)
Related information
Provide any related information
9 remaining items
jzabroski commentedon Oct 18, 2019
Closing the solution in VisualStudio (without closing VisualStudio) appears to fix the problem. You can then safely re-open the solution.
Probably the right way to fix this is to use .NET Core AssemblyLoadContext and load the entire F# toolchain inside a context, and hook any critical exceptions as a clue to unload the context and reload it. I'm not sure if DevENV supports such logic, but it seems in 2016 .NET added support for .NET Core global exception handlers. -- It's not clear how that works and how the DevENV would know "oh crap, F# died, need to reload" although maybe the "object sender" property or the EventArgs might contain clues.
jzabroski commentedon Oct 18, 2019
@dsyme I suggest the simplest way to try to repro this problem is to load a "toxic alpha" verison of F# Plug-in into Visual Studio that crashes on any function named jzabroski (or similar). I think this will demonstrate the design-time only aspect of this bug.
jzabroski commentedon Oct 18, 2019
I think I put together exactly what happens in my case.
jzabroski commentedon Dec 19, 2019
@cartermp As per discussion on Twitter, just beeping a horn. Please don't add me to github-drama :)
cartermp commentedon Dec 20, 2019
@jzabroski Thanks, I think there are two or more separate issues based on what you're describing.
cartermp commentedon Dec 20, 2019
Just to clarify, are these valid for VS 2019 Update 16.4.?
jzabroski commentedon Dec 20, 2019
Most likely. Definitely for 16.3.8 (I think) - I try not to touch the F# project as its a time sink. FWIW, These "basic compilation doesn't work smoothly" issues have only gotten worse and worse over time. It used to be the thing that would piss off my engineers is that the bootstrap of the FSharp.Core.dll and Tools from C# would cause weird nuget restore errors (my favorite was when the nuget package for the version we were using was somehow deleted). Then it precipitated into random runtime crashes while debugging.
I'm not an F# expert, but I also noticed other weird things with F# IntelliSense that I could not understand based on the documentation. In particular, sometimes the tooltip that displays type inference would change the order of the expression. Maybe that's an expected behavior, but it went away when I added type annotations.
jzabroski commentedon Dec 20, 2019
@cartermp Also verified I am not utilizing Resharper's Build Speed-up tool (I only use its refactoring engine).
jzabroski commentedon Dec 20, 2019
I did some tests for you - it does seem a bit more stable. Can I ask if you have any regression tests against things like referencing a c# static (or instance) class in the same project (not a nuget package).