FSC : error FS0193: The device is not ready - f#

My project (net472) builds fine on my regular PC with .
On another PC I get this Error. It points to line 1 on FSC. FSC is not a file in my project.
What might be the reason for this?
FSC : error FS0193: The device is not ready.
VisualStudio.16.Release/16.3.4+29409.12
Microsoft .NET Framework
Version 4.8.03752
Visual F# Tools 10.4 for F# 4.6 16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823
Microsoft Visual F# Tools 10.4 for F# 4.6

The problem was that the fsproj file (new SDK) had a non existing path at the App Icon rescource for the exe file.
<Win32Resource>D:\Git\XXX\Media\AppIcon.res</Win32Resource>
I changed this to a relative path and the build was fine again.
<Win32Resource>Media\AppIcon.res</Win32Resource>

Related

Installing F# in visual studio code

I am trying to install F# with Visual studio code in Windows 10. I have installed dotnet framework first.
Then I have installed lonide-fsharp in visual studio code.
Then I have included the path of fsi in visual studio by clicking the Preferences->extensions->selected F# and Included the path.
Now in the visual studio code I typed ctrl+shift+p then I have typed fsi start, I am getting an error.
I tried with '/' and '\'. in the path. Every time I change I uninstalled the lonide and installed it again.
When I do fsi start ,F# should get started or what are all the other ways that I can make F# to start.
What is happening here is 'C:/Program Files/dotnet/sdk/3.0.100/FSharp/fsi the path does not exist'.
First, make sure you have the latest version of VS Code and Ionide.
Then, if you install the .NET Core 3.0 SDK from https://dotnet.microsoft.com/download, then it should install fsi.exe to that path. And then F# Interactive should just work with Ionide without any other configuration needed.

F# (mono) for VS Code on MacOS : bugs

I'm trying to use F# with VS Code (v1.17.2) on MacOS (Sierra 10.12.6)
I think i've installed latest versions of Mono and .NET SDK
I'm trying just to build the simple project described here as a test
https://github.com/s952163/FSharpVSCode
after my default installation, I could do a MSBuild and run the program in the terminal without any problem. However at that stage,
(1) Intellisense is not working properly, not recognizing Deedle
(2) in the F# explorer it would say
'TestProject1.fsproj (load failed)
when doing a right-click i got this error
Error: MSBuild failed with exitCode 1 Working Directory:
'/Users/francois-guillaume.rideau/Documents/FsharpVsCode/TestProject1'
Exe Path: 'dotnet' Args: 'msbuild
/Users/francois-guillaume.rideau/Documents/FsharpVsCode/TestProject1/TestProject1.fsproj
/p:SkipCompilerExecution=true /p:ProvideCommandLineArgs=true
/p:CopyBuildOutputToOutputDirectory=false
/p:UseCommonOutputDirectory=true /t:_Inspect_FscArgs
/p:_Inspect_FscArgs_OutFile=/var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/tmp52c377ed.tmp.FscArgs.txt
/p:DesignTimeBuild=true /t:_Inspect_GetResolvedProjectReferences
/p:_Inspect_GetResolvedProjectReferences_OutFile=/var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/tmpfe4a2c2.tmp.GetResolvedProjectReferences.txt
/t:_Inspect_GetProperties
/p:_Inspect_GetProperties_OutFile=/var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/tmpfe4a2c2.tmp.GetProperties.txt
/nologo /verbosity:quiet' Log: writing helper target file in
'/Users/francois-guillaume.rideau/Documents/FsharpVsCode/TestProject1/obj/TestProject1.fsproj.proj-info.targets'
/usr/local/share/dotnet/sdk/2.0.2/Microsoft.Common.CurrentVersion.targets(1122,5):
error MSB3644: The reference assemblies for framework
".NETFramework,Version=v4.6.1" were not found. To resolve this,
install the SDK or Targeting Pack for this framework version or
retarget your application to a version of the framework for which you
have the SDK or Targeting Pack installed. Note that assemblies will be
resolved from the Global Assembly Cache (GAC) and will be used in
place of reference assemblies. Therefore your assembly may not be
correctly targeted for the framework you intend.
[/Users/francois-guillaume.rideau/Documents/FsharpVsCode/TestProject1/TestProject1.fsproj]
to try to solve this, i typed in the following
export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/
but worse, after that, the project doesn't build anymore in VS Code as I get this output when trying (Cmd-Shift-P) MSBuild: Build Project
/usr/local/share/dotnet/sdk/2.0.2/Microsoft.Common.CurrentVersion.targets(1122,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [/Users/francois-guillaume.rideau/Documents/FsharpVsCode/TestProject1/TestProject1.fsproj]
screenshot here https://imgur.com/KtMM2Bu
VS Code environment is passed to msbuild when it invokes it, so setting environment variables on startup of VS Code does the trick:
FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/ code .
Go to project location in the terminal and then run FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/ code . as said before.
Then you should be able to build again.

VS 2010, TFS 2013 SGEN: An attempt was made to load an assembly with an incorrect format

I am working on a conversion of tfs 2013 build definition, we were initially using tfs 2008.I have a new server with TFS2013 installed and working on Build definition for 2013 xaml (workflow) customization is completed. However i am facing an error when my TFS build in release mode for Any Cpu configuration, but its fine when i use debug mode. I have tried looking many articles and unable to find any solution kindly help me here. This is fine in my local machine but happens only in the server.
Project and details
1) project is .net framework 4.0
2)Default configuration is "Any Cpu"
3)TFS 2013 server is 64 bit, windows server 2008 r2
Build Definition
Configuration : Any CPU|Release
MsBuildPlatform : x86
Error:
SGEN: An attempt was made to load an assembly with an incorrect format: C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll.
Warning:
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets (990): The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
I have installed windos 8 SDK (Tools only)
and Windows framework 4 x64 as x86 version is failing
The folder C:\Program Files\Microsoft SDKs\Windows has v7.0 folder
C:\Program Files (x86)\Microsoft SDKs\Windows has v8.1A folder
where as my local machine has many versions inside the windows folder in above path
List of related articles which i have checked,but couldn't find a solution
http://seravy.wordpress.com/2012/10/25/installing-net-4-5-and-not-windows-sdk-8/
http://blogs.msdn.com/b/windowssdk/archive/2009/09/16/windows-7-sdk-setup-common-installation-issues-and-fixes.aspx
Running MSBuild fails to read SDKToolsPath
http://dukelupus.wordpress.com/2008/02/05/task-failed-because-sgenexe-was-not-found-solution/
How do I fix the Visual Studio compile error, "mismatch between processor architecture"?
TFS 2010 creating .Net 4.0 XmlSerializers DLL for .Net 3.5 Application
So what should i do to fix this error ?
You need to install the targeting packs (aka SDK, aka Developer pack) for the .NET Framework version you are targeting. You can download them all from http://blogs.msdn.com/b/dotnet/p/dotnet_sdks.aspx
Specifically for your question and targeting .NET Framework 4.0, you want Windows SDK for Windows 7 and .NET Framework 4 Sounds like you grabbed the Windows 8 SDK, which is not what you want for targeting .NET Framework 4.0.
This is not a very good answer (but in case someone comes across it like me), and does not provide insight into why it is occurring. But turning off "Generate the serialization assembly" on the offending project does allow for the build to work in my case.
Start up times will be slower, as serialization will occur at runtime instead now.
You simply need to see what framework you are using and then what debug mode you are using.
In my case i was using framework 4.0 and Build mode target framework "any cpu" but after searching around i found that i need to upgrade my .Net framework from 4.0 to 4.5 and i have to build my solution from "any cpu" to x86 framework because i had Windows 7 SPI with x86 architecture.
Here are some images what i have done to solve this error.
I encountered this error (albeit for a newer .NET framework version, v4.5.1, not v4.0 as in the original question) when trying to build my application on a build server.
The combination of the following two conditions was responsible for the error:
In Visual Studio, on the Project Properties page, on the Application tab, the "Target framework" was set to ".NET Framework 4.5.1";
On the build server, in folder C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework, a folder named v4.5.1 was not present. (Other folders with version numbers, including v3.5, v4.0, and v4.5, were present.)
This missing folder was the cause of the "The reference assemblies for framework ... were not found" warning, which in turn lead to the "assembly with an incorrect format" error.
The fix was to install Windows Software Development Kit (SDK) for Windows 8.1 on the build server. In the install wizard, in the "Select the features you want to install" step, I unchecked all boxes except for the one for ".NET framework 4.5.1 Software Development Kit".
Running that install caused the missing v4.5.1 folder in the Reference Assemblies\Microsoft\Framework.NETFramework folder to be created, and the build to run successfully.
I am reluctant to answer because you say you have already done this, but every time I have struggled with the error message you quote, it has been the MsBuildPlatform setting. It absolutely has to be set to "X86". Are you sure the setting is being set..?

Problems building a simple F# project in Xamarin Studio on Windows 8

I've had VS2013 installed on my windows 8 laptop and F# works fine.
I've since installed Xamarin Studio version 4.2.2 but unfortunately can't get any F# project to build even a very simple one.
I installed F# Version 3.0 from the Web Installer and have installed the F# addin in Xamarin Studio and restarted it. Compiling the simple Console Project just gives me the error:
Error: Build failed. See the build log for details.
With no other details anywhere.
In the fsproj file There is the following:
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets"
I'm not sure where the MSBuildExtensionPath32 is set or where it currently points to but if I update this to a hard-coded path that actually points at my file:
<Import Project="C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets" />
Then when I build the project in xamarin it builds successfully.
Is there an easy way of setting the MSBuildExtensionsPath32 to my actual path for xamarin? I don't really want to resort to having to set up a .bat file to launch it but can't find an option in xamarin to configure it.
I feel I must be missing something.
Thanks
It looks like the F# project templates are using a path to an older version of F#. There is a discussion about this on the GitHub repository for the F# addin. Hopefully the project template can be updated to support different versions of F# being installed. For now you can modify your project file.
MSBuildExtensionsPath32 points to C:\Program Files (x86)\MSBuild
So you could try modifying the project template to use the following path, which should work on your machine:
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets" />

don't have apk in Bin and cannot build app in monodevelop when update Mono for Android 4.1

After update Mono for Android from 4.0 -> 4.1 ,I have problems:
In Visual Studio : when I start application , it doesn't run application in emulator(I only see message notification at left corner Build successful!) and I cannot see .apk file in Bin
In Mono develope :When I build this app it have error Error MSB4019: The imported project "C:\Program Files (x86)\MonoDevelop\AddIns\BackendBindings\MSBuild\Novell\Novell.MonoDroid.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. (MSB4019)
Does anyone know what might generate these errors?
In VS, you probably need to turn on "Deploy" for your project:
http://docs.xamarin.com/android/Releases/Mono_For_Android_4/Mono_for_Android_4.1.0#Non-modal_Deployment

Resources