F# - FSI- Load source file "Process is terminated due to StackOverflowException" - f#

I have updated Visual Studio Community 2019 to Version 16.11.4 and when I try to load a source file (i.e.: Library1.fs) into the FSI environment (trough Alt+Enter or writing the #load command inside the FSI environment inside VISUAL STUDIO), I get the Stack Overflow Exception error:
Microsoft (R) F# Interactive versione 11.4.2.0 per F# 5.0
Copyright (C) Microsoft Corporation. Tutti i diritti sono riservati.
Per informazioni, digitare #help;;
#load "C:\Users\GianLuca\Source\Repos\x\x\Library1.fs";;
Process is terminated due to StackOverflowException.
Session termination detected.
This happen everytime I try to “Load” any source file, event an empty source file!!
NOTE: I’m using F-Sharp Library (.NET Framework 4.72), but the same occurs with CLASS LIBRARY (.NTE STANDARd or .NET CORE)
NOTE: if I lunch “dotnet fsi” from the command prompt (cmd) - outside form Visual Studio - and I try to “Load” the same files, it works fine (no Stack Overflow Exception!).
NOTE: I have launched the REPAIR action from the VISUAL STUDIO INSTALLER, but the problem persists.
How I can resolve it? I’m confused.
It seems a problem of F# INTERACTIVE inside Visual Studio Community 2019 Version 16.11.4
Many thanks in advance!
(See also: https://developercommunity.visualstudio.com/t/F---FSI--Load-source-file-Process-is-t/1550593)

Related

"Csc.exe" could not be run. Access is denied (MSB6003)

I just downloaded and installed Xamarin and selected the ASP.NET MVC template. I haven't touched anything. When I build the solution I get the following error:
Could not add packages.
"The specified task executable "Csc.exe" could not be run. Access is denied (MSB6003)".
This is at the end of messages displayed on the Package Console:
Added file 'packages.config'.
An exception was thrown while dispatching a method call in the UI thread.
I'm running Windows 8.1 and Visual Studio Community 2015.
Any ideas?

Visual Studio 2013 Preview, Google Test Runner Could not load file or assembly F#

While trying to add Unit Tests to my current project I ran into the Google Test Runner plugin for Visual Studio 2012 and 2013. When I however try to run tests using this I run into the following error:
------ Run test started ------
Found 2 tests, resolving symbols
Loading symbols from C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\tests.exe
Retrieving the COM class factory for component with CLSID {BCE36434-2C24-499E-BF49-8BD99B0EEB68} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Running: C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\tests.exe --gtest_output=xml:C:\Users\MYUSER\AppData\Local\Temp\tmpB2DE.tmp
Opened results from C:\Users\MYUSER\AppData\Local\Temp\tmpB2DE.tmp
Could not load file or assembly 'FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at FSharp.Data.RuntimeImplementation.XmlOperations.GetChildrenArray(XmlElement value, String nameWithNS)
at FSharp.Data.RuntimeImplementation.XmlOperations.ConvertArray[R](XmlElement xml, String nameWithNS, Func`2 f)
at GoogleTestRunner.ResultParser.getResults(IMessageLogger logger, String outputPath, IEnumerable`1 testCases)
at GoogleTestRunner.GoogleTestExecutor.runOnce(IFrameworkHandle framework, Boolean debug, FSharpList`1 cases, String executable, Boolean runAll)
at GoogleTestRunner.GoogleTestExecutor.runTests(IEnumerable`1 tests, IRunContext runContext, IFrameworkHandle framework, Boolean runAll)
No test is available in C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\tests.exe. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.
========== Run test finished: 0 run (0:00:04.7380291) ==========
I'm not known with F# and don't see what problem is causing this or how to solve it, the page says it's compatible with Visual Studio 2013. The tests are correctly discovered and viewable in the text explorer but don't run.
Edit:
Sometimes after a build I get this:
------ Discover test started ------
GoogleTest: Does C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\MY PROJECT.exe match [Tt]est[s]{0,1}.exe: false
GoogleTest: Does C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\Tests.exe match [Tt]est[s]{0,1}.exe: true
Found 2 tests, resolving symbols
Loading symbols from C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\Tests.exe
Retrieving the COM class factory for component with CLSID {BCE36434-2C24-499E-BF49-8BD99B0EEB68} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
GoogleTest: Does C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\WorldServer.exe match [Tt]est[s]{0,1}.exe: false
========== Discover test finished: 2 found (0:00:00.2372256) ==========
Try installing this NuGet package:
http://www.nuget.org/packages/FSharp.Core.3/
I think you just need the F# runtime.
EDIT: Per Layl Conway, this is what was actually needed to allow the Google Test Runner to run:
F# Tools for Visual Studio Express 2012 for Web
EDIT2: For sake of completeness there's also this blog post (from the answer to another SO question):
http://www.heartysoft.com/build-fsharp-3-on-build-server-without-vs
For the impatient:
Clicking the Direct Download Link (
http://go.microsoft.com/fwlink/?LinkId=261286 if you’re too busy)
downloads VWD_FSharp.msi which is only 7.55MB, doesn’t include Azure
tools, VS and all the other stuff. Builds work, the universe is right
again.
FSharp.Core, Version=4.3.0.0
That's the version included with VS2012 and F# 3.0. VS2013 with F# 3.1 has FSharp.Core V4.3.1.0.
Ensure your project settings for the F# project(s) are set to use the right—and consistent—version of the F# runtime.

Cannot create Controller and View in ASP.NET MVC

I have Visual Studio 2010 with MVC 2 installed. I am able to create a MVC 2 Web Application and build the project with the original code. However, I cannot create any new Controller or View page to the project. When I try to create a Controller, I got this error:
c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Item Templates\CSharp\Web\MVC 2\CodeTemplates\AddController\Controller.tt(-1, -1): error: There was a problem getting an AppDomian to run the transformation from the host. The process cannot continue."
When I try to create a View, I get this error:
c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Item Templates\CSharp\Web\MVC 2\CodeTemplates\AddView\Empty.tt(-1, -1): error: There was a problem getting an AppDomian to run the transformation from the host. The process cannot continue."
I have tried to reinstall the VS and SP1, but that didn't solve the problem.
How can this be fixed?
I had this error this morning in Visual Studio 2010 on Windows 10 while running through an MVC2 tutorial I found. I restarted and reloaded the solution, it created the view right away.

F# interactive shell (fsi) tutorial?

I'm learning F# with fsi on Mac OS X/mono, but it's hard to know what command to quit and out to shell.
quit, or ^D doesn't work, ^C also doesn't work. What's the command to to stop the fsi?
In general, where can I find some tutorial/user's guide about fsi?
Use #help;; for help, #quit;; to quit.
When I start F# in OS X/mono I get the following
~> fsi
Microsoft (R) F# 2.0 Interactive build 2.0.0.0
Copyright (c) Microsoft Corporation. All Rights Reserved.
For help type #help;;
By typing #help I get:
> #help;;
F# Interactive directives:
#r "file.dll";; Reference (dynamically load) the given DLL
#I "path";; Add the given search path for referenced DLLs
#load "file.fs" ...;; Load the given file(s) as if compiled and referenced
#time ["on"|"off""];; Toggle timing on/off
#help;; Display help
#quit;; Exit
F# Interactive command line options:
See 'fsi --help' for options
>
These should provide your answers.

SharpDevelop: "Could not find fsi.exe" even when f# is installed

I installed a copy of f# on my machine (on a secondary drive), and when i try to start the F# interactive prompt, it says it could not find fsi.exe. Do i need to copy some files somewhere or something?
You could try to look here:
"%ProgramFiles(x86)%\Microsoft SDKs\F#\<fsharp_version>\Framework\<dotnet_version>\Fsi.exe"
With the VS 15.8 update it appears to have been moved. I found it in:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp\fsi.exe
Could you be more specific with your repro steps? I assume you are using the latest, May 2009 CTP? Also, when you say 'start the F# Interactive prompt' are you talking about launching it from the start menu?
On most machines it will be exactly:
"C:\Program Files (x86)\FSharp-1.9.7.4\bin\fsi.exe"
If you did something non-standard it could just be a bug in the installer. E.g., did you override the Program Files folder for your F# installation by passing in a command line parameter to msiexec?
Do a quick search for fsi.exe on your machine (the console F# interactive window) and point your shortcut there.

Resources