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

Error during restoring packages, only happens on some machines #403

Open
UweKeim opened this issue Jan 8, 2025 · 2 comments
Open

Error during restoring packages, only happens on some machines #403

UweKeim opened this issue Jan 8, 2025 · 2 comments

Comments

@UweKeim
Copy link

UweKeim commented Jan 8, 2025

When doing this with version 4.8.25.0:

css -nuget:restore "C:\myproject\Deploy\Build\\do-build.cs"

I get this output on my own development Windows 11 PC:

Restoring packages...
   Microsoft.Data.SqlClient
   Microsoft.Data.SqlClient.SNI
   Microsoft.SqlServer.SqlManagementObjects
   morelinq
   Newtonsoft.Json
   NuGet.Versioning
   QuickUploader.WebApiAccessor
   RestSharp
   SharpZipLib
   ZetaDeployer.RuntimeUploader
   ZetaShortPaths
Mapping packages to assemblies...
Compile: OK

I.e. everything compiles OK on my PC.

In contrast, one the developer PCs of my co-workers (Windows 11, too), they get something like this as the output:

Restoring packages...
   Microsoft.Data.SqlClient
   Microsoft.Data.SqlClient.SNI
   Microsoft.SqlServer.SqlManagementObjects
   morelinq
   Newtonsoft.Json
   NuGet.Versioning
   QuickUploader.WebApiAccessor
   RestSharp
   SharpZipLib
   ZetaDeployer.RuntimeUploader
   ZetaShortPaths
Error: Specified file could not be compiled.
Could not find a part of the path 'C:\Users\someone\AppData\Local\Temp\csscript.core\nuget\195c4e67-9d31-438a-b7a1-45b083a2dfa3\publish'.

I.e. they get this error:

Could not find a part of the path 'C:\Users\someone\AppData\Local\Temp\csscript.core\nuget\195c4e67-9d31-438a-b7a1-45b083a2dfa3\publish'.

We tried to delete all possible locations:

  • The "do-build.nuget.cs" file.
  • The "C:\Users\someone\AppData\Local\Temp\csscript.core" folder.
  • The "C:\Users\someone.nuget" folder.

And then we ran the script again, only to see the same error occurring.

We also tried to omit the script call with --nuget:restore and directly rund the script:

css /dbg "C:\myproject\Deploy\Build\\do-build.cs"

But this also lead to the same erroneous result.


My question

Do you have any idea/clue what might cause this error on the machines of most of my co-workers?

oleg-shilo added a commit that referenced this issue Jan 9, 2025
- #403: Error during restoring packages, only happens on some machines
@oleg-shilo
Copy link
Owner

I have a guess...

Most likely it is because some packages cannot be downloaded (e.g. required nuget source/feed is not configured).

Unfortunately, the CS-Script does not log detailed information about restore failures which makes it difficult to interpret the observed behaviour. It only says that the folder with the restored packages has not been found.

I have fixed the logging and the improvement will be available in the very next release.

But for you, to troubleshoot it right now, I have attached the temp project that cs-script creates at runtime for restoring the packages.
f36ff485-8d24-46f6-aa1d-51c720ba795f.zip

You can just unzip it anywhere and execute dotnet publish and you will see the problem details in the dotnet output.
In my case I could not download QuickUploader package:

image

oleg-shilo added a commit that referenced this issue Jan 9, 2025
- #403: Error during restoring packages, only happens on some machines
@UweKeim
Copy link
Author

UweKeim commented Jan 9, 2025

Thank you very much for your great help, Oleg!

We will try your suggestion and see whether we can figure something out.

oleg-shilo added a commit that referenced this issue Jan 11, 2025
CLI
- #403: Error during restoring packages, only happens on some machines
- added setting the `csws.exe` shim on Windows when executing command `css -self-install`
- Improved temp file management. Triggered by #401

CSScriptLib
- Improved temp file management. Triggered by #401
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