Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 5: can't build F# projects #12954

Closed
rolfbjarne opened this issue Aug 18, 2020 · 3 comments
Closed

.NET 5: can't build F# projects #12954

rolfbjarne opened this issue Aug 18, 2020 · 3 comments
Assignees

Comments

@rolfbjarne
Copy link
Member

Test files:

  • AssemblyInfo.fs
namespace fsharplibrary
open System.Reflection

[<assembly: AssemblyVersion("1.0.0.0")>]

()
  • fsharlibrary.fsproj
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp5.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="AssemblyInfo.fs" />
  </ItemGroup>
</Project>
  • Build:
$ dotnet build /nologo
  Determining projects to restore...
  All projects are up-to-date for restore.
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
/usr/local/share/dotnet/sdk/5.0.100-rc.1.20411.10/Microsoft.Common.CurrentVersion.targets(4207,5): error : Expected file "obj/Debug/netcoreapp5.0/ref/fsharplibrary.dll" does not exist. [/Users/rolf/test/dotnet/fsharplibrary/fsharplibrary.fsproj]

Build FAILED.

/usr/local/share/dotnet/sdk/5.0.100-rc.1.20411.10/Microsoft.Common.CurrentVersion.targets(4207,5): error : Expected file "obj/Debug/netcoreapp5.0/ref/fsharplibrary.dll" does not exist. [/Users/rolf/test/dotnet/fsharplibrary/fsharplibrary.fsproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.75

Zipped test case:
fsharplibrary-d885c90.zip

.NET version (on macOS 10.15.6):

$ dotnet --version
5.0.100-rc.1.20411.10

It looks like this regressed in #12720, if I comment out the line that sets ProduceReferenceAssembly to true then the build works.

mmitche pushed a commit to mmitche/sdk that referenced this issue Aug 18, 2020
…12954)

* Update dependencies from https://github.com/dotnet/core-setup build 20191021.9

- Microsoft.NETCore.App.Ref - 3.1.0-preview2.19521.9
- Microsoft.NET.HostModel - 3.1.0-preview2.19521.9
- Microsoft.Extensions.DependencyModel - 3.1.0-preview2.19521.9
- Microsoft.DotNet.PlatformAbstractions - 3.1.0-preview2.19521.9
- Microsoft.NETCore.DotNetHostResolver - 3.1.0-preview2.19521.9
- Microsoft.NETCore.App.Runtime.win-x64 - 3.1.0-preview2.19521.9

* Update dependencies from https://github.com/dotnet/core-setup build 20191021.11

- Microsoft.NETCore.App.Ref - 3.1.0-preview2.19521.11
- Microsoft.NET.HostModel - 3.1.0-preview2.19521.11
- Microsoft.Extensions.DependencyModel - 3.1.0-preview2.19521.11
- Microsoft.DotNet.PlatformAbstractions - 3.1.0-preview2.19521.11
- Microsoft.NETCore.DotNetHostResolver - 3.1.0-preview2.19521.11
- Microsoft.NETCore.App.Runtime.win-x64 - 3.1.0-preview2.19521.11

* Update dependencies from https://github.com/dotnet/core-setup build 20191021.13

- Microsoft.NETCore.App.Ref - 3.1.0-preview2.19521.13
- Microsoft.NET.HostModel - 3.1.0-preview2.19521.13
- Microsoft.Extensions.DependencyModel - 3.1.0-preview2.19521.13
- Microsoft.DotNet.PlatformAbstractions - 3.1.0-preview2.19521.13
- Microsoft.NETCore.DotNetHostResolver - 3.1.0-preview2.19521.13
- Microsoft.NETCore.App.Runtime.win-x64 - 3.1.0-preview2.19521.13

Dependency coherency updates

- System.Text.Json - 4.7.0-preview2.19521.5 (parent: Microsoft.NETCore.App.Runtime.win-x64)
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this issue Aug 21, 2020
Context: xamarin/Xamarin.Android.FSharp.ResourceProvider#6

Xamarin.Android.FSharp.ResourceProvider 1.0.1 is now built for
`netstandard2.0` and published to an internal feed.

We should be able to enable F# tests under a `dotnet` context now.

The `_RemoveLegacyDesigner` MSBuild target was running, when it
shouldn't be for F# projects and adding a `Resource.designer.cs`
`@(Compile)` item. I needed to add a `$(Language)` check.

One workaround is for:

dotnet/sdk#12954

We need to set `$(ProduceReferenceAssembly)` to `false` for .NET 5 F#
projects at the moment.
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this issue Aug 21, 2020
Context: xamarin/Xamarin.Android.FSharp.ResourceProvider#6

Xamarin.Android.FSharp.ResourceProvider 1.0.1 is now built for
`netstandard2.0` and published to an internal feed.

We should be able to enable F# tests under a `dotnet` context now.

The `_RemoveLegacyDesigner` MSBuild target was running, when it
shouldn't be for F# projects and adding a `Resource.designer.cs`
`@(Compile)` item. I needed to add a `$(Language)` check.

One workaround is for:

dotnet/sdk#12954

We need to set `$(ProduceReferenceAssembly)` to `false` for .NET 5 F#
projects at the moment.
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this issue Aug 24, 2020
Context: xamarin/Xamarin.Android.FSharp.ResourceProvider#6

Xamarin.Android.FSharp.ResourceProvider 1.0.1 is now built for
`netstandard2.0` and published to an internal feed.

We should be able to enable F# tests under a `dotnet` context now.

The `_RemoveLegacyDesigner` MSBuild target was running, when it
shouldn't be for F# projects and adding a `Resource.designer.cs`
`@(Compile)` item. I needed to add a `$(Language)` check.

One workaround is for:

dotnet/sdk#12954

We need to set `$(ProduceReferenceAssembly)` to `false` for .NET 5 F#
projects at the moment.
@dsplaisted
Copy link
Member

The workaround should be to set the ProduceReferenceAssembly property to false.

@rolfbjarne
Copy link
Member Author

The workaround should be to set the ProduceReferenceAssembly property to false.

Yes, that works, and that's what I did.

jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this issue Sep 1, 2020
Context: xamarin/Xamarin.Android.FSharp.ResourceProvider#6

Xamarin.Android.FSharp.ResourceProvider 1.0.1 is now built for
`netstandard2.0` and published to an internal feed.

We should be able to enable F# tests under a `dotnet` context now.

The `_RemoveLegacyDesigner` MSBuild target was running, when it
shouldn't be for F# projects and adding a `Resource.designer.cs`
`@(Compile)` item. I needed to add a `$(Language)` check.

One workaround is for:

dotnet/sdk#12954

We need to set `$(ProduceReferenceAssembly)` to `false` for .NET 5 F#
projects at the moment.
@sfoslund
Copy link
Member

sfoslund commented Sep 1, 2020

This was fixed by #13085

@sfoslund sfoslund closed this as completed Sep 1, 2020
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this issue Sep 1, 2020
Context: xamarin/Xamarin.Android.FSharp.ResourceProvider#6

Xamarin.Android.FSharp.ResourceProvider 1.0.1 is now built for
`netstandard2.0` and published to an internal feed.

We should be able to enable F# tests under a `dotnet` context now.

The `_RemoveLegacyDesigner` MSBuild target was running, when it
shouldn't be for F# projects and adding a `Resource.designer.cs`
`@(Compile)` item. I needed to add a `$(Language)` check.

One workaround is for:

dotnet/sdk#12954

We need to set `$(ProduceReferenceAssembly)` to `false` for .NET 5 F#
projects at the moment.
jonathanpeppers added a commit to dotnet/android that referenced this issue Sep 2, 2020
Context: xamarin/Xamarin.Android.FSharp.ResourceProvider#6

Xamarin.Android.FSharp.ResourceProvider 1.0.1 is now built for
`netstandard2.0` and published to an internal feed.

We should be able to enable F# tests under a `dotnet` context now.

The `_RemoveLegacyDesigner` MSBuild target was running, when it
shouldn't be for F# projects and adding a `Resource.designer.cs`
`@(Compile)` item. I needed to add a `$(Language)` check.

One workaround is for:

dotnet/sdk#12954

We need to set `$(ProduceReferenceAssembly)` to `false` for .NET 5 F#
projects at the moment.

The second workaround is for:

dotnet/linker#1448

F# generics are causing an NRE in the linker.
filipnavara added a commit to filipnavara/xamarin-macios that referenced this issue Oct 12, 2020
Contributes to xamarin#8901. Issue dotnet/sdk#12954 was marked as fixed, the dotnet version was recently bumped to one that should contain the fix.
rolfbjarne pushed a commit to xamarin/xamarin-macios that referenced this issue Oct 13, 2020
Contributes to #8901. Issue dotnet/sdk#12954 was marked as fixed, the dotnet version was recently bumped to one that should contain the fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants