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

Could not find a part of the path #381

Open
344089386 opened this issue Jul 24, 2024 · 3 comments
Open

Could not find a part of the path #381

344089386 opened this issue Jul 24, 2024 · 3 comments

Comments

@344089386
Copy link

Occasional:
Could not find a part of the path 'C:\Users\semitech\AppData\Local\Temp\CSSCRIPT\36880.d03ac708-8d9d-4062-9763-503deb6a1852.tmp.cs'.

What's going on, please

@oleg-shilo
Copy link
Owner

oleg-shilo commented Jul 24, 2024

This is a temp file containing a complete C# code created from your C# code fragment that is a script.
The script creates this file and then passes it to the C# compiler that is configured on your system. So something deleting or locking this file. Can it be antivirus?

If it becomes unusable you can try to change the compiler engine with the -ng switch. Check all available options with css -ng ?

But from my memory

css -ng:dotnet sample.cs
css -ng:csc sample.cs
css -ng:csc-inproc sample.cs
css -ng:roslyn-inproc sample.cs
css -ng:roslyn sample.cs

@344089386
Copy link
Author

344089386 commented Jul 25, 2024

I haven't used 'css -ng :dotnet', can you give me a detailed link? @oleg-shilo

@oleg-shilo
Copy link
Owner

You just execute css -ng ? and it will print the CLI usage of this switch.
Alternatively, you can specify the same switch directly from the script code. IE:

//css_ng dotnet

<your script code>

CS-Script always converts C# script into an assembly and executes it.

What this switch does it tells CS-Script which C# compiler to use for building the assembly.

  1. dotnet - means prepare a C# project on-fly, build the assembly and destroy the project (part of .NET SDK)
  2. csc - means compile assembly from C# source file with csc.exe C# compiler (part of .NET SDK) as external process
  3. roslyn - means compile assembly from C# code with .NET Roslyn Compiler (compiler-as-service nuget package)

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

2 participants