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

Cache from different scripts refers to the same folder #752

Open
orange-world-developer-two opened this issue Apr 22, 2024 · 1 comment
Open
Labels

Comments

@orange-world-developer-two
Copy link

In my situation, there are two network paths available:

  1. \\server-dev\SHARE\Projects\app\start.csx
  2. \\server-prod\SHARE\Projects\app\start.csx

But there's only one in the cache folder:
C:\Users\orange\AppData\Local\Temp\dotnet-script\UNC\Projects\app...

The start.csx script runs without mounting the disk.
The folders have different configurations, but the same cache is used during the call, which makes the script work incorrectly.
The path "\\server-dev" and "\\server-prod" is lost in the cache.

@filipw
Copy link
Member

filipw commented Apr 22, 2024

Normally the drive letter would be part of the cache path, but for network paths we indeed normalize them UNC

As a workaround, you can set DOTNET_SCRIPT_CACHE_LOCATION environment variable to have a custom cache path. If that path is not rooted, it will be used as relative path from the perspective of the script, which would allow you to avoid collisions.

@filipw filipw added the bug label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants