1

Closed

NuGet 2.1 warns when using portable in the tools folder

description

We're getting the following warnings when using 2.1 to package a nuspec that uses portable in the tools folders:
     Issue: Unrecognized PowerScript file.
     Description: The script file 'tools\portable-net40+sl4+win8+wp71\Install.ps1' is not recognized by NuGet and hence will not be executed during installation of this package.
     Solution: Rename it to install.ps1, uninstall.ps1 or init.ps1 and place it directly under 'tools'.

     Issue: Unrecognized PowerScript file.
     Description: The script file 'tools\portable-net40+sl4+win8+wp71\Uninstall.ps1' is not recognized by NuGet and hence will not be executed during installation of this package.
     Solution: Rename it to install.ps1, uninstall.ps1 or init.ps1 and place it directly under 'tools'.
This script seems to run correctly, and Package Manager recognizes it.

file attachments

Closed Mar 29, 2013 at 4:54 PM by danliu

comments

dotnetjunky wrote Oct 18, 2012 at 7:41 PM

Fixed in changeset a6701080baf6

bhuvak wrote Oct 29, 2012 at 8:50 PM

** Closed by bhuvak 10/29/2012 12:50PM

danliu wrote Nov 17, 2012 at 12:35 AM

re-activate this bug, as I saw the install.ps1 is running from the root of the tools folder.

Repro steps:
  1. create a portable library project targeting .net40, sl4, wp7 and win8 and above.
  2. Install the test package.
test package is attached.

error seen:

PM> install-package bug2724 -version 2.0.0.0
Successfully installed 'bug2724 2.0.0.0'.
This is called from the fallback folder.
This warning is called from the fallback folder.
Successfully added 'bug2724 2.0.0.0' to PortableClassLibrary1.
c:\users\danliu\documents\visual studio 2012\Projects\PortableClassLibrary1\packages\bug2724.2.0.0.0\tools
c:\users\danliu\documents\visual studio 2012\Projects\PortableClassLibrary1\packages\bug2724.2.0.0.0\tools
Exception calling "OpenFile" with "1" argument(s): "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
At C:\users\danliu\documents\visual studio 2012\Projects\PortableClassLibrary1\packages\bug2724.2.0.0.0\tools\install.ps1:33 char:1
  • $dte.ItemOperations.OpenFile((Join-Path $toolsPath 'EF4.3on.NET4.5Readme.txt'))
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : ComMethodTargetInvocation

dotnetjunky wrote Nov 19, 2012 at 9:30 PM

This error comes from the install.ps1 from under the 'tools' folder. This is a bug of the package, not a nuget bug.

** Closed by dotnetjunky 11/19/2012 1:30PM

dotnetjunky wrote Nov 19, 2012 at 11:57 PM

dotnetjunky wrote Nov 21, 2012 at 12:51 AM

Fixed in changeset 8022e248a83e

dotnetjunky wrote Mar 28, 2013 at 11:35 PM

Fixed in changeset 8022e248a83e14c37adf93148bb5a65b59e1c8bc

dotnetjunky wrote Mar 28, 2013 at 11:35 PM

Fixed in changeset a6701080baf6c3d6b8300919c36b6a338dc3766d