Closed iwasdavid closed 5 years ago
For anyone interested, the reason my build was failing was because I had referenced the SQLProvider twice!
Here is the correct .fsproj
:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<FscToolPath>/Library/Frameworks/Mono.framework/Versions/Current/Commands</FscToolPath>
<FscToolExe>fsharpc</FscToolExe>
</PropertyGroup>
<ItemGroup><!-- Mono fix -->
<Reference Include="FSharp.Data.SqlProvider">
<HintPath>/Users/davidlowe/.nuget/packages/SQLProvider/1.1.57/lib/net451/FSharp.Data.SqlProvider.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.4.0" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="cp /Users/davidlowe/.nuget/packages/System.Data.SqlClient/4.4.0/runtimes/unix/lib/netstandard2.0/System.Data.SqlClient.dll bin/Debug/netcoreapp2.0/" />
</Target>
</Project>
Description
When trying to build a simple console app in Mac OSX referencing SQLProvider, the build fails.
Repro steps
Using the following .fsproj I would expect my project to build
Expected behavior
dotnet build
to succeed.Actual behavior
dotnet restore
succeeds.dotnet build
fails with message:Known workarounds
None.
Build Diagnostics