Skip to content

Relative path for cscs.exe -out option results in wrong output folder #255

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

Closed
maettu-this opened this issue Sep 23, 2021 · 3 comments
Closed

Comments

@maettu-this
Copy link
Collaborator

To reproduce:

PS C:\Workspaces\CSScript\Issue #255> .\cscs.exe -cd -out:.\Some\Lib.dll .\Some\Lib.cs
Created: .\Some\Lib.dll
PS C:\Workspaces\CSScript\Issue #255> cd .\Some\
PS C:\Workspaces\CSScript\Issue #255\Some> dir                                                            

    Verzeichnis: C:\Workspaces\CSScript\Issue #255\Some


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       23.09.2021     15:24                Some
-a----       21.09.2021     18:45            110 Lib.cs


PS C:\Workspaces\CSScript\Issue #255\Some> cd .\Some\
PS C:\Workspaces\CSScript\Issue #255\Some\Some> dir                                                       

    Verzeichnis: C:\Workspaces\CSScript\Issue #255\Some\Some


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       23.09.2021     15:24          10240 Lib.dll


PS C:\Workspaces\CSScript\Issue #255\Some\Some>                                                           

Instead of .\Some\Lib.dll, output goes to .\Some\Some\Lib.dll.

Reference:

PS C:\Workspaces\CSScript\Issue #255> .\cscs.exe
C# Script execution engine. Version 3.30.5.2.
Copyright (C) 2004-2018 Oleg Shilo. www.csscript.net (github.com/oleg-shilo/cs-script)

   CLR:             4.0.30319.42000 (.NET Framework v4.8 or later)
   System:          Microsoft Windows NT 6.2.9200.0
   Corlib:          C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll
   Architecture:    x64
   Install dir:     <not integrated>
   Location:        C:\Workspaces\CSScript\Issue #255\cscs.exe
   Config file:     C:\Workspaces\CSScript\Issue #255\css_config.xml
   Compiler:        <default>
   NuGet manager:   C:\Programs\NuGet\nuget.exe
   NuGet cache:     C:\ProgramData\CS-Script\nuget

I'll attach the files in a minute.

@maettu-this
Copy link
Collaborator Author

Issue #255.zip

@maettu-this
Copy link
Collaborator Author

PS: Note that cscs.exe of 3.30.5.2 erroneously outputs 2004-2018 while the release was in 2020.

@oleg-shilo
Copy link
Owner

Thank you. Indeed the behaviour is not correct.

The initial intention for the -out option was to build the assembly in the very same folder where the script is.
But the use-case you described is actually more useful so I will update the -out algorithm to handle your use-case.

Txs. Good suggestion.

oleg-shilo pushed a commit that referenced this issue Nov 4, 2021
- Updated `-speed` and `-code` with the complete support `-ng:*` switches
- Added `IEvaluator.IsCachingEnabled`. Ite as always available from the conctrete types implementing `IEvaluator` and now it is moved directly to the interface.
- Added `-servers:start` and `-servers:stop` command to control both Roslyn and csc build servers at the same time
- CSScriptLib: Native API `CacheEnabled` marked as obsolete
- Issue #258: Can not run scripts after installing VS2022
- Issue #257: Ability to catch AppDomain.UnhandledException in a not-hosted script (cscs)
- Issue #255: Relative path for cscs.exe -out option results in wrong output folder
- Issue #254: Script merger for hosted scripts
- Issue #253: Supports both .Net Framework and .Net 5
- Issue #252: System.NullReferenceException: Object reference not set to an instance of an object. (updated API doc)
- Added auto-generation of the CLI MD documentation with `-help cli:md`. To be used to generate GitHub wiki page during the build
- Fixed Debian packaging problem (`/n/r` needed replacement with `\n`)
oleg-shilo added a commit that referenced this issue Nov 14, 2021
### Misc

- Added auto-generation of the CLI MD documentation with -help cli:md. To be used to generate GitHub wiki page during the build
- Fixed Debian packaging problem (/n/r needed replacement with \n)
- Issue #253: Supports both .Net Framework and .Net 5

### CLI

- Updated -speed and -code with the complete support -ng:* switches
- Added -servers:start and -servers:stop command to control both Roslyn and csc build servers at the same time
- Issue #258: Can not run scripts after installing VS2022
- Issue #257: Ability to catch AppDomain.UnhandledException in a not-hosted script (cscs)
- Issue #255: Relative path for cscs.exe -out option results in wrong output folder
- Issue #254: Script merger for hosted scripts
- Issue #252: System.NullReferenceException: Object reference not set to an instance of an object. (updated API doc)

### CSScriptLib

- Native API CacheEnabled marked as obsolete
- Added IEvaluator.IsCachingEnabled. It is always available from the concrete types implementing IEvaluator and now it is moved directly to the interface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants