You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create library LibraryUsingTypeprovider with the following contents
namespaceLibraryUsingTypeprovider// This is only here, because otherwise the F# compiler is smart enough to optimize the reference away...openFSharp.DataopenFSharp.Data.JsonExtensionsmoduleWrapped =letuseSomething(j :JsonValue)=
j?Major.AsInteger()
with references to FSharp.Compiler.Service and LibraryUsingTypeprovider.
Run Repro.exe
Expected behavior
Starting Target: RunRepro (==> BuildRepro)
bin/repro/Repro.exe
F# Interactive for F# 4.0 (private)
Freely distributed under the Apache 2.0 Open Source License
For help type #help;;
> [Loading C:\PROJ\FSharp.Compiler.Service_585\myscript.fsx]
TEST_OUTPUT
(Choice1Of2 null, [||])
Actual behavior
Starting Target: RunRepro (==> BuildRepro)
bin/repro/Repro.exe
F# Interactive for F# 4.0 (private)
Freely distributed under the Apache 2.0 Open Source License
For help type #help;;
> [Loading C:\PROJ\FSharp.Compiler.Service_585\myscript.fsx]
Stopped due to error
(Choice2Of2
System.Exception: Operation could not be completed due to earlier error,
[|C:\PROJ\FSharp.Compiler.Service_585\myscript.fsx (2,1)-(2,83) parse error The type provider 'C:\PROJ\FSharp.Compiler.Service_585\bin\repro\FSharp.Data.dll' reported an error: Assembly attribute 'TypeProviderAssemblyAttribute' refers to a designer assembly 'FSharp.Data.DesignTime' which cannot be loaded or doesn't exist. Could not load file or assembly 'file:///C:\PROJ\FSharp.Compiler.Service_585\bin\repro\FSharp.Data.DesignTime.dll' or one of its dependencies. The system cannot find the file specified.;
C:\PROJ\FSharp.Compiler.Service_585\myscript.fsx (2,1)-(2,83) parse warning Referenced assembly 'C:\PROJ\FSharp.Compiler.Service_585\bin\repro\FSharp.Data.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found|])
Known workarounds
Bundling the type provider design assembly should work
Removing the reference in Repro to LibraryUsingTypeprovider seems to work as well (matthid/fcs_bug_585@a36921b).
Related information
Windows 10
FSharp.Compiler.Service 3.0.0.0 Release (2.0.0.6 has same behavior)
.NET Runtime 4.6
VS 2015
I couldn't reproduce this with the fsi -> When running the failing code within fsi everything seems to work as expected.
--- Initial Report
In fsprojects/FAKE#1274 I noticed that design assemblies of type providers seem to be required, even for indirect references, even when the code trying to compile is not using the type provider at all.
Is this by design or a bug? If it is a bug I can try to create a repro for it. Shouldn't the F# compiler only request the design-assembly when it's needed (lazily)?
I'm not sure if this happens with the regular compiler as well (it probably isn't as much of a problem there as with nuget we have the design assemblies available, even for indirect dependencies), but for now this was detected by using FSharp.Compiler.Service.
The text was updated successfully, but these errors were encountered:
Yeah sure, but I think this isn't easy to reproduce. So when anyone can quickly say if this sounds like a bug or not, it would save me quite some time ... Should the design assembly be needed when the code to compile doesn't use the type provider directly (for example via indirect dependencies)? If yes there is no point reproducing this.
matthid
changed the title
Type Providers design assembly required without direct reference?
Type Providers design assembly required without direct reference.
Jun 18, 2016
Repro steps
Provide the steps required to reproduce the problem
git clone https://github.com/matthid/fcs_bug_585.git
cd fcs_bug_585
./build.sh
(git bash) orbuild.cmd
What this does is:
Create library
LibraryUsingTypeprovider
with the following contentswith a reference to
FSharp.Data
Create a console application
Repro
withwith references to
FSharp.Compiler.Service
andLibraryUsingTypeprovider
.Run
Repro.exe
Expected behavior
Actual behavior
Known workarounds
Repro
toLibraryUsingTypeprovider
seems to work as well (matthid/fcs_bug_585@a36921b).Related information
I couldn't reproduce this with the
fsi
-> When running the failing code withinfsi
everything seems to work as expected.--- Initial Report
In fsprojects/FAKE#1274 I noticed that design assemblies of type providers seem to be required, even for indirect references, even when the code trying to compile is not using the type provider at all.
Is this by design or a bug? If it is a bug I can try to create a repro for it. Shouldn't the F# compiler only request the design-assembly when it's needed (lazily)?
I'm not sure if this happens with the regular compiler as well (it probably isn't as much of a problem there as with nuget we have the design assemblies available, even for indirect dependencies), but for now this was detected by using FSharp.Compiler.Service.
The text was updated successfully, but these errors were encountered: