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

scriptcs -install stopped working #1310

Open
dagid4 opened this issue Jun 17, 2020 · 1 comment
Open

scriptcs -install stopped working #1310

dagid4 opened this issue Jun 17, 2020 · 1 comment

Comments

@dagid4
Copy link

dagid4 commented Jun 17, 2020

It looks like NuGet.Core no longer works (it is deprecated for a while) and packages now cannot be installed with scriptcs -install. It may be related to:

NuGet.org will permanently remove support for TLS 1.0 and 1.1 on June 15th. Please ensure that your systems use TLS 1.2.

Please confirm:

C:\Users\*****\Desktop\scriptcs-scriptcs-ceb8443\src\ScriptCs\bin\Release>scriptcs -install Castle.Core
Installing packages...
ERROR: Error installing package. [InvalidOperationException] Unable to find package 'Castle.Core'.
ERROR: Package installation failed. [AggregateException] One or more errors occurred.
C:\Users\*****\Desktop\scriptcs-scriptcs-ceb8443\src\ScriptCs\bin\Release>scriptcs -install Moq
Installing packages...
ERROR: Error installing package. [InvalidOperationException] Unable to find package 'Moq'.
ERROR: Package installation failed. [AggregateException] One or more errors occurred.

If package is cached, then it works:

C:\Users\*****\Desktop\scriptcs-scriptcs-ceb8443\src\ScriptCs\bin\Release>scriptcs -install Newtonsoft.Json
Installing packages...
Installed: Newtonsoft.Json
Package installation succeeded.
Saving packages in scriptcs_packages.config...
Creating scriptcs_packages.config...
Added Newtonsoft.Json (v9.0.1, .NET 4.5) to scriptcs_packages.config
Successfully updated scriptcs_packages.config.

Make sure you try on package you haven't used yet.

@evbo
Copy link

evbo commented Sep 12, 2020

Here's a work around to unblock installing packages until scriptcs maintainers fix this issue (short answer: just use NuGet directly):

  • download latest version of nuget.exe (put it somewhere that's added on your Path)
  • create a new directory for your project (or use existing project directory) and cd into there
  • create a scriptcs_packages folder
  • perform an install with: nuget install <packageId> -OutputDirectory scriptcs_packages
  • Optional steps (for easier dependency management):
    • List the version(s) of packages you just installed:
      nuget list -Verbose -Source <absolute path to scriptcs_packages>
    • For each entry, add the packageId and version to your packages.config manually (unless someone knows how to automate?)
    • Next time you want to install, run: nuget install -OutputDirectory scriptcs_packages

Example package.config (notice my steps above don't show how to obtain targetFramework - sorry look this up elsewhere):

<?xml version="1.0" encoding="utf-8"?>
<packages>
    <package id="ScriptCs.Wpf" version="0.1.4" targetFramework="net45" />
</packages>

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