cs-script icon indicating copy to clipboard operation
cs-script copied to clipboard

UNC

Open lwennekers opened this issue 2 years ago • 3 comments

I'm trying to use a script by using an UNC path. This gives a filenotfoundexception but the file exist. Even the user rights seem to be correct. Is there a reason this is not working? Thanks already in advance for your support

lwennekers avatar Aug 22 '22 14:08 lwennekers

not sure what is happening there. I tested and it seems to work fine

PS Microsoft.PowerShell.Core\FileSystem::\\TEST-PC\private_repos> css -new script
Created: \\TEST-PC\private_repos\script.cs
PS Microsoft.PowerShell.Core\FileSystem::\\TEST-PC\private_repos> css script
------------------------------------
Date: 24/08/2022 5:45:55 PM
Hello from C# 9
{IEnumerable} - 5 items
  [0]: [ProgramFiles(x86)]: "C:\Program Files (x86)"
  [1]: [ChocolateyInstall]: "C:\ProgramData\chocolatey"
  [2]: [CSScriptRuntimeLocation]: "C:\ProgramData\chocolatey\lib\cs-script\tools\cscs.dll"
  [3]: [WEB_APP]: "C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\6.0.8"
  [4]: [FPS_BROWSER_APP_PROFILE_STRING]: "Internet Explorer"
------------------------------------

Interestingly enough command prompt could not handle this scenario. I only managed to get it right with WT

oleg-shilo avatar Aug 24 '22 07:08 oleg-shilo

I forgot to mention that I'm using .net 4.8 with the 3.30.5.1 version. I tried the 4 version but it has to many differences from wat we are using. Hereby a piece of our code where programFile is a file using an unc-path

CSScript.CacheEnabled = false; CSScript.CompilingHistory.Clear(); CSScript.CompileWithConfig(programFile, programFilePath, false, CSScript.GlobalSettings, "/preferreduilang:en-US", null);

Thanks again

lwennekers avatar Aug 24 '22 18:08 lwennekers

Sorry, it's really hard for me to support you on the no longer supported edition of CS-Script. About two years ago after maintaining both editions (.NET Core and .NET FX) in parallel for 3 years I had no choice but to move on with .NET Core only. As the whole industry did.

You can read about that decision here: https://github.com/oleg-shilo/cs-script/wiki/Transition-from-.NET-Framework-to-.NET

Thus what you are experiencing is most likely a limitation that is addressed in the current version of the product. I understand that the change of API (even if insignificant) can still be painful to port on. But your best chance for your product is indeed with the .NET Core runtime so you may need to migrate even for non CS-Script reasons.

Since the initial release of .NET Core edition CS-Script has gained support for the CodeDOM compilation engine the majority of the old functionality is now matched in the latest releases.

oleg-shilo avatar Aug 26 '22 14:08 oleg-shilo