Skip to content

[Paket] This type has been forwarded to assembly #1392

@aggieben

Description

@aggieben

I'm facing an issue similar to what's described in #1390 . I have a benchmark projects that builds for net47 and netcoreapp2.1 and have been having various problems with the generated benchmark programs not being able to load referenced assemblies properly. This is an F♯ program, using paket to reference the necessary nupkgs.

I'm running this on macOS with .NET Core SDK 3.1.

The projects containing the code being benchmarked all target netstardard2.0. At benchmark time, the output looks like this:

// Build Error: The build has failed!
CS1069: The type name 'File' could not be found in the namespace 'System.IO'. This type has been forwarded to assembly 'System.IO.FileSystem, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.
CS1069: The type name 'Console' could not be found in the namespace 'System'. This type has been forwarded to assembly 'System.Console, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.
CS1069: The type name 'Console' could not be found in the namespace 'System'. This type has been forwarded to assembly 'System.Console, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.
CS1069: The type name 'Console' could not be found in the namespace 'System'. This type has been forwarded to assembly 'System.Console, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.
CS1069: The type name 'Console' could not be found in the namespace 'System'. This type has been forwarded to assembly 'System.Console, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.
CS1069: The type name 'Enumerable' could not be found in the namespace 'System.Linq'. This type has been forwarded to assembly 'System.Linq, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.
CS1069: The type name 'Enumerable' could not be found in the namespace 'System.Linq'. This type has been forwarded to assembly 'System.Linq, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.
CS1069: The type name 'Enumerable' could not be found in the namespace 'System.Linq'. This type has been forwarded to assembly 'System.Linq, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.

The project file:

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFrameworks>netcoreapp2.1;net47</TargetFrameworks>
    <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="Prolog.fs" />
    <Compile Include="Schema.fs" />
    <Compile Include="AsyncSchema.fs" />
    <Compile Include="AsyncValBenchmark.fs" />
    <Compile Include="ParsingBenchmark.fs" />
    <Compile Include="ExecutionBenchmark.fs" />
    <Compile Include="MiddlewareBenchmark.fs" />
    <Compile Include="Program.fs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="paket.references" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\..\src\FSharp.Data.GraphQL.Shared\FSharp.Data.GraphQL.Shared.fsproj" />
    <ProjectReference Include="..\..\src\FSharp.Data.GraphQL.Server\FSharp.Data.GraphQL.Server.fsproj" />
    <ProjectReference Include="..\..\src\FSharp.Data.GraphQL.Server.Middleware\FSharp.Data.GraphQL.Server.Middleware.fsproj" />
  </ItemGroup>

  <Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>

The paket.references file:

System.Reactive
FSharp.Core

group TestsAndSamples
BenchmarkDotNet
Microsoft.NETFramework.ReferenceAssemblies

The latest full code is here, if you're interested: https://github.com/aggieben/FSharp.Data.GraphQL/tree/netcore-update/tests/FSharp.Data.GraphQL.Benchmarks

Any help with this would be appreciated.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions