Closed chinwobble closed 6 years ago
@chinwobble i cannot repro. (win10 - ionide v3.15.7). is a project cracker issue, not of ionide itself.
what's the msbuild version? you have any VS installed?
can you try, as possible workaround to use the fsac .net core? use a different project parser.
enable it with setting "FSharp.fsacRuntime": "netcore"
and open vscode from a prompt where msbuild is in PATH (likethe VS Command Prompt)
@enricosada thanks for your quick reply here are the details you requrested:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
However when I open an Xamarin android project it fails to load (it successfully loads in visual studio but has never loaded in VSCode before) It gives the following output:
Error:
MSBuild failed with exitCode 1 Working Directory: 'c:\dev\DaisyApp\DaisyApp.Droid' Exe Path: 'msbuild' Args: 'c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj /p:CopyBuildOutputToOutputDirectory=false /p:UseCommonOutputDirectory=true /p:BuildingInsideVisualStudio=true /p:ShouldUnsetParentConfigurationAndPlatform=true /t:Build /p:_Inspect_CoreCompilePropsOldSdk_OutFile=C:\Users\benne\AppData\Local\Temp\tmp2ED.tmp.CoreCompilePropsOldSdk.txt /p:DesignTimeBuild=true /t:_Inspect_GetResolvedProjectReferences /p:_Inspect_GetResolvedProjectReferences_OutFile=C:\Users\benne\AppData\Local\Temp\tmp2FE.tmp.GetResolvedProjectReferences.txt /t:_Inspect_GetProperties /p:_Inspect_GetProperties_OutFile=C:\Users\benne\AppData\Local\Temp\tmp2FF.tmp.GetProperties.txt /p:CustomAfterMicrosoftCommonTargets=C:\Users\benne\AppData\Local\Temp\tmp30F.tmp.proj-info.oldsdk-hook.targets /nologo /verbosity:quiet' Log: writing helper target file in 'C:\Users\benne\AppData\Local\Temp\tmp30F.tmp.proj-info.oldsdk-hook.targets' packages.config : warning XA0101: @(Content) build action is not supported [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "Microsoft.CSharp" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "FSharp.Core" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2153,3): warning MSB3277: Found conflicts between different versions of "FSharp.Core" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2153,3): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1667,5): error MSB4018: The "LinkAssemblies" task failed unexpectedly. [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1667,5): error MSB4018: System.IO.FileNotFoundException: Could not load assembly 'DaisyApp.Droid, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile? [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1667,5): error MSB4018: File name: 'DaisyApp.Droid.dll' [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1667,5): error MSB4018: at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters) in /Users/builder/data/lanes/5749/d8c6e504/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:line 229 [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1667,5): error MSB4018: at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.GetAssembly(String fileName) in /Users/builder/data/lanes/5749/d8c6e504/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:line 164 [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1667,5): error MSB4018: at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res) [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1667,5): error MSB4018: at Xamarin.Android.Tasks.LinkAssemblies.Execute() [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1667,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj] C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1667,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() [c:\dev\DaisyApp\DaisyApp.Droid\DaisyApp.Droid.fsproj]
@chinwobble nice that FSharp.fsacRuntime: netcore
works. that use the new project parser, previous one (projectcracker) has issues (like you have seen). it is going to be possibile in the near future to use it also with fsacRuntime: net
, but please just use fsacRuntime: netcore
for now as workaround.
this setting can be applied to workaround that repository (Open Workspace Setting
command), no need to be set per user (Open User Settings
command) if you want
About the Xamarin android project, can you share the fsproj? just that, not the source files? a repro will be is the best :D
@enricosada ooops sorry forgot to add the xamarin android fsproj file. Please find it below:
The error happens with several xamarin android apps I have tried to open in VSCode.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProjectGuid>{7527A41F-0A76-4058-A414-DAD1A9585660}</ProjectGuid>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{F2A71F9B-5D33-465A-A702-920D77279786}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>GWallet.Frontend.XamForms.iOS</RootNamespace>
<AssemblyName>GWallet.Frontend.XamForms.iOS</AssemblyName>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<SelectedDevice>Simulator</SelectedDevice>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
<MtouchFastDev>true</MtouchFastDev>
<IOSDebuggerPort>26913</IOSDebuggerPort>
<MtouchLink>None</MtouchLink>
<MtouchArch>x86_64</MtouchArch>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchFloat32>true</MtouchFloat32>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchArch>ARM64</MtouchArch>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
<GenerateTailCalls>true</GenerateTailCalls>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
<MtouchLink>None</MtouchLink>
<MtouchArch>x86_64</MtouchArch>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
<GenerateTailCalls>true</GenerateTailCalls>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<CodesignKey>iPhone Developer</CodesignKey>
<DeviceSpecificBuild>true</DeviceSpecificBuild>
<MtouchDebug>true</MtouchDebug>
<MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
<MtouchFastDev>true</MtouchFastDev>
<MtouchFloat32>true</MtouchFloat32>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<IOSDebuggerPort>47389</IOSDebuggerPort>
<MtouchLink>Full</MtouchLink>
<MtouchArch>ARM64</MtouchArch>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\..\packages\Xamarin.Forms.2.3.4.247\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\packages\Xamarin.Forms.2.3.4.247\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>..\..\packages\Xamarin.Forms.2.3.4.247\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\packages\Xamarin.Forms.2.3.4.247\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Net.Http" />
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\packages\Newtonsoft.Json.10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="crypto">
<HintPath>..\..\packages\Portable.BouncyCastle.1.8.1.1\lib\netstandard1.3\crypto.dll</HintPath>
</Reference>
<Reference Include="EdjCase.JsonRpc.Core">
<HintPath>..\..\packages\EdjCase.JsonRpc.Core.1.3.1\lib\portable45-net45+win8+wpa81\EdjCase.JsonRpc.Core.dll</HintPath>
</Reference>
<Reference Include="EdjCase.JsonRpc.Client">
<HintPath>..\..\packages\EdjCase.JsonRpc.Client.1.3.1\lib\portable45-net45+win8+wpa81\EdjCase.JsonRpc.Client.dll</HintPath>
</Reference>
<Reference Include="Plugin.Clipboard.Abstractions">
<HintPath>..\..\packages\Xamarin.Plugins.Clipboard.2.0.0\lib\Xamarin.iOS10\Plugin.Clipboard.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Plugin.Clipboard">
<HintPath>..\..\packages\Xamarin.Plugins.Clipboard.2.0.0\lib\Xamarin.iOS10\Plugin.Clipboard.dll</HintPath>
</Reference>
<Reference Include="NBitcoin">
<HintPath>..\..\packages\NBitcoin.3.0.2.24\lib\netstandard1.3\NBitcoin.dll</HintPath>
</Reference>
<Reference Include="SharpRavenLight">
<HintPath>..\..\packages\SharpRavenLight.1.0.0-beta5\lib\netstandard2.0\SharpRavenLight.dll</HintPath>
</Reference>
<Reference Include="Nethereum.Hex">
<HintPath>..\..\packages\Nethereum.Hex.2.0.1\lib\netstandard1.1\Nethereum.Hex.dll</HintPath>
</Reference>
<Reference Include="Nethereum.Util">
<HintPath>..\..\packages\Nethereum.Util.2.0.1\lib\netstandard1.1\Nethereum.Util.dll</HintPath>
</Reference>
<Reference Include="Nethereum.ABI">
<HintPath>..\..\packages\Nethereum.ABI.2.0.1\lib\netstandard1.1\Nethereum.ABI.dll</HintPath>
</Reference>
<Reference Include="Nethereum.JsonRpc.Client">
<HintPath>..\..\packages\Nethereum.JsonRpc.Client.2.0.1\lib\netstandard1.1\Nethereum.JsonRpc.Client.dll</HintPath>
</Reference>
<Reference Include="Nethereum.RPC">
<HintPath>..\..\packages\Nethereum.RPC.2.0.1\lib\netstandard1.1\Nethereum.RPC.dll</HintPath>
</Reference>
<Reference Include="Nethereum.JsonRpc.RpcClient">
<HintPath>..\..\packages\Nethereum.JsonRpc.RpcClient.2.0.1\lib\netstandard1.1\Nethereum.JsonRpc.RpcClient.dll</HintPath>
</Reference>
<Reference Include="Nethereum.Contracts">
<HintPath>..\..\packages\Nethereum.Contracts.2.0.1\lib\netstandard1.1\Nethereum.Contracts.dll</HintPath>
</Reference>
<Reference Include="Nethereum.RLP">
<HintPath>..\..\packages\Nethereum.RLP.2.0.1\lib\netstandard1.1\Nethereum.RLP.dll</HintPath>
</Reference>
<Reference Include="Nethereum.KeyStore">
<HintPath>..\..\packages\Nethereum.KeyStore.2.0.1\lib\netstandard1.1\Nethereum.KeyStore.dll</HintPath>
</Reference>
<Reference Include="Nethereum.Signer">
<HintPath>..\..\packages\Nethereum.Signer.2.0.1\lib\netstandard1.1\Nethereum.Signer.dll</HintPath>
</Reference>
<Reference Include="Nethereum.Web3">
<HintPath>..\..\packages\Nethereum.Web3.2.0.1\lib\netstandard1.1\Nethereum.Web3.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json">
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Assets.xcassets\Contents.json">
<Visible>false</Visible>
</ImageAsset>
<InterfaceDefinition Include="LaunchScreen.storyboard" />
<None Include="Info.plist" />
<None Include="Entitlements.plist" />
<Compile Include="AppDelegate.fs" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GWallet.Frontend.XF\GWallet.Frontend.XF.fsproj">
<Project>{19C613A6-21D8-4120-8E5D-C092193D1003}</Project>
<Name>GWallet.Frontend.XF</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.FSharp.targets" />
<Import Project="..\..\packages\Xamarin.Forms.2.3.4.247\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.4.247\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
</Project>
The error happens with several xamarin android apps I have tried to open in VSCode.
good, mean the bug is only one usually :D
Thanks a lot @chinwobble .The issue is not with ionide itself, but of the project parser library used (https://github.com/enricosada/dotnet-proj-info).
created this https://github.com/enricosada/dotnet-proj-info/issues/15 to track it.
Closing. the work will continue in https://github.com/enricosada/dotnet-proj-info/issues/15 and the fix will be integrated in ionide when dotnet.projinfo
library will be fixed..
When I try to load the following file in VSCode Ionide I get the following output:
Specs:
Output
FSProj File:
Full project can be cloned from here: https://github.com/chinwobble/DaisyParser
Click to expand for whole fsproj
```xml