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

Typeprovider works in IDE but test project compile fails with 'assembly not found' #396

Closed
fwaris opened this issue Oct 18, 2023 · 2 comments

Comments

@fwaris
Copy link

fwaris commented Oct 18, 2023

Description

I generated a typeprovider using the dotnet template.
It was working fine until the 3rd party libraries were 'revved'.
Now, the typeprovider works in the test project in the IDE but the test project itself does not compile with dotnet build:

C:\Users\fwaris1\source\repos\SKProvider\tests\SKProvider.Tests\SKProvider.Tests.fs(25,11): error FS3033: The type provider 'SKProviderImplementation+SKTypeProvider' reported
 an error: Could not load file or assembly 'Microsoft.SemanticKernel.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3'. The system cannot find 
the file specified. 

I have attached the output of "dotnet build -v d > out.txt".

I can see that the fsc command line args look fine. It seems when the typeprovider code tries to generate the types, it cannot find the assemblies that it needs at build time. (I don't think that the exact assembly it cannot find, matters here.)

Please provide the steps required to reproduce the problem

  1. Clone repo https://github.com/fwaris/SKProvider

  2. Set environment variable SK_SAMPLES_HOME to ** [your project root]/tests\SKProvider.Tests\skills**. The typeprovider 'test' project loads files from here for the provided types.

  3. Perform the usual build:
    -- dotnet tool restore
    -- dotnet paket update
    -- dotnet build

  • Operating system: windows
  • Branch: main
  • .NET Runtime, CoreCLR or Mono Version: .net 7 sdk
@fwaris
Copy link
Author

fwaris commented Oct 18, 2023

cannot attach build output for some reason

@fwaris
Copy link
Author

fwaris commented Oct 29, 2023

Was able to get around this specific issue - mostly by studying other typeprovider codes.
(Now need to brush up on F# metaprogramming!)

@fwaris fwaris closed this as completed Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant