Paket auto-generate scripts uses wrong current directory with type providers
See original GitHub issueI’m sceptical if this is a Paket issue per se but interested if anyone else has seen this: -
#load @"..\..\paket-files\include-scripts\net452\include.main.group.fsx"
/// load some other files
open FSharp.ExcelProvider
/// open some other namespaces
type Component = ExcelFile< @"..\..\data\DataFile.xlsx">
This appears fine in the IDE (Code or VS) but when compiled gives this error: -
BatchImport.fsx(20,18): error FS3033: The type provider 'ExcelProvider.ExcelProvider+ExcelProvider' reported an error: Could not open file 'c:\Users\Isaac\Source\Repos\myProject\paket-files
\include-scripts\net452\..\..\data\DataFile.xlsx'. DirectoryNotFoundException - Could not find a part of the path 'c:\Users\Isaac\Source\Repos\myProject\paket-files\data\DataFile.xlsx'.
Note that the path it’s using is relative to where the paket script was loaded, rather than where the script I’m working in was loaded. Is this: -
- A Paket issue?
- An ExcelProvider issue?
- Something more fundamental with how scripts are loaded within the context of F# and Type Providers?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Ability to specify the directory to run poetry in instead of ...
I'm developing a command line script that depends on the working directory. It's actually a tool for working with git repositories, so it ......
Read more >Mono executes program with wrong current directory
I have tried to create absolute paths from relative paths in the program using Path.GetFullPath() and Environment.CurrentDirectory but ...
Read more >How to execute a script in a different directory than ...
So you give wrong path. The dot there doesn't mean "execute". It's just part of the path. In shell you normally type either...
Read more >release-notes
A dependency manager for .NET with support for NuGet packages and git repositories.
Read more >Command: plan | Terraform
The terraform plan command creates an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@isaacabraham I’ve used the FSharp.Data.SqlClient and few other type providers from such scripts, although I always SOURCE_DIRECTORY as a reference, I think it would solve your problem:
Yeah,
__SOURCE_DIRECTORY__
fixes the problem I think.