Unable to install a package I've made - Target Framework Error :(

Jan 10, 2011 at 5:59 AM

Hi folks,

so i've created a package of my library and I'm testing it out, locally. I try to install it into a project and it's failing. I don't get it :(

 

PM> Install-Package YUICompressor.NET
Successfully installed 'YUICompressor.NET 1.5.0.0'
Install-Package : Unable to find assembly references that are compatible with the target framework '.NETFramework,Version=v3.5'
At line:1 char:16
+ Install-Package <<<< YUICompressor.NET
	+ CategoryInfo	: NotSpecified: (:) [Install-Package], InvalidOperationException
	+ FullyQualifiedErrorId : NuGet.VisualStudio.Cmdlets.InstallPackageCmdlet

PM>

 

:~~~(

Here's my .xml file which i run against nuget.exe... (btw, it doesn't like the TAGS element, yet).

 

<?xml version="1.0" encoding="utf-8"?>
<package>
    <metadata>
        -- lots of snip snip snip --
    </metadata>
    <files>
        <file src="..\Projects\Yahoo.Yui.Compressor\Model\bin\Release\*.dll" target="lib\NET35" />
        <file src="..\Projects\Yahoo.Yui.Compressor\Model.Net20\Model.Net20\bin\Release\*.dll" target="lib\NET20" />
    </files>
</package>

 

I'm trying to add this to a .NET 4.0 console app and a .NET 3.5 console app.

When i go and see what's been downloaded into the packages folder (it did say, Successfully installed, above) .. i have this structure...

 

C:\blah...\Solution Root\packages\YUICompressor.NET.1.5.0.0\lib\NET35\0\Projects\YUICompressor\Projects\Yahoo.Yui.Compressor\Model\bin\Release\ 2x dll files in here

 

What the? 

Shouldn't it just be 

 

C:\blah...\Solution Root\packages\YUICompressor.NET1.5.0.0\lib\NET35\ and the two files in here?

 

:(

Developer
Jan 10, 2011 at 6:17 AM

What version of nuget.exe are you using? 

Jan 10, 2011 at 6:19 AM
Edited Jan 10, 2011 at 6:22 AM

 

R:\NuGet-Command-Line-Tool>NuGet.exe
NuGet Version: 1.0.10128.22
usage: NuGet <command> [args] [options]
Type 'NuGet help <command>' for help on a specific command.

Available commands:

 help (?)   The Help command is used to display general help and also help information about other commands.
 list (l)   Displays a list of packages at a given source. If no source is define the default feed is used.
 pack (p)   Creates a NuGet package based on the provided NuSpec file.
 push       Push a package to the server and publish it to the feed.

R:\NuGet-Command-Line-Tool>

and ...
NuGet Package Manager:
Date Installed: 4/01/2011
Version: 1.0.10128.89
Developer
Jan 10, 2011 at 6:58 AM
Edited Jan 10, 2011 at 6:58 AM

If you look inside your created package (rename it to zip) does it preserve the entire folder structure within lib? I know we're had alot of bugs around this in the past. Can you try this version of nuget.exe and see if it still repros?

http://ci.nuget.org:8080/repository/download/bt4/1093:id/Console/NuGet.exe

 

Developer
Jan 10, 2011 at 9:39 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jan 10, 2011 at 10:37 PM

@David - i just downloaded v 1.1.2110.100 of nuget.exe

I then ran => nuget pack "C:\my long path\to\my\project\solution items\my package spec.xml"

which created the  nupkg file.

Closed VS2010. Opened VS2010. Tried to install my latest package ... and same error message.

Also - the entire folder structure is within 'lib' folder (in the package), btw.

Developer
Jan 10, 2011 at 11:59 PM

Looks like a bug

Jan 11, 2011 at 12:11 AM
Edited Jan 11, 2011 at 12:13 AM

*sad trombone *

Ok :) Is there anything I can do to help try and give some info, for this bug report? Movie captures, folder structures, extra logging information when I create a new package, share my desktop so it can be remote controlled by you guys (using TeamViewer, for example)?

Developer
Jan 11, 2011 at 2:21 AM

The issue was easy to reproduce, I'll try and have a bug fix for it really soon.

Jan 11, 2011 at 2:37 AM

@Pranavkm - cheers mate :) much appreciated!

/me bows low

Developer
Jan 12, 2011 at 1:39 AM

Could you try the most recent version - http://ci.nuget.org:8080/guestAuth/repository/download/bt4/.lastSuccessful/Console/NuGet.exe?

Jan 12, 2011 at 2:51 AM
Edited Jan 12, 2011 at 2:52 AM

@Pranavkm : confirmed that the entire folder structure IS NOT preserved any more. Great news!

/lib
    \_NET35
    \_NET20

etc.

But, i'm still getting the initial error :-

 

PM> Install-Package yuicompressor.net
Successfully installed 'YUICompressor.NET 1.5.0.0'
Install-Package : Unable to find assembly references that are compatible with the target framework '.NETFramework,Version=v4.0'
At line:1 char:16
+ Install-Package <<<<  yuicompressor.net
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGet.VisualStudio.Cmdlets.InstallPackageCmdlet

 

 

and when i change my dummy project from 4.0 to 3.5

 

PM> Install-Package yuicompressor.net
'YUICompressor.NET 1.5.0.0' already installed
Install-Package : Unable to find assembly references that are compatible with the target framework '.NETFramework,Version=v3.5'
At line:1 char:16
+ Install-Package <<<<  yuicompressor.net
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGet.VisualStudio.Cmdlets.InstallPackageCmdlet

 

??? :~(

Is this an issue with my library folders renamed incorrectly?

Developer
Jan 12, 2011 at 4:09 AM

What does your package look like?

Jan 12, 2011 at 4:14 AM
Edited Jan 12, 2011 at 4:14 AM

@David: heh - wish girls would have asked me that, years ago :)

Ok .. .. not sure how to attach a file here, so i've uploaded it to this evil upload file site :(

look for the text in the bottom right corner of the webpage => Save file to your PC: Download

or i can email/ftp/upload it anywhere else.

Jan 12, 2011 at 4:24 AM
Now that's funny! Maybe we can use something of that concept for our tagline. :D

NuGet - What does your package look like?

I like it. :D

On Tue, Jan 11, 2011 at 10:14 PM, purekrome <notifications@codeplex.com> wrote:

From: purekrome

@dfowler : heh - wish girls would have asked me that, years ago :)

Ok .. .. not sure how to attach a file here, so i've uploaded it to this evil upload file site :(

look for the text in the bottom right corner of the webpage => Save file to your PC: Download

or i can email/ftp/upload it anywhere else.

Read the full discussion online.

To add a post to this discussion, reply to this email (nuget@discussions.codeplex.com)

To start a new discussion for this project, email nuget@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Developer
Jan 12, 2011 at 4:43 AM

lol. I just wanted to know the layout of files in your package

Jan 12, 2011 at 4:47 AM

this?

 

Developer
Jan 12, 2011 at 4:52 AM

I downloaded your package and I was able to install it into a .net35 and .net40 web application. What version of nuget are you using? (Type $host.Version in the console).

Jan 12, 2011 at 4:57 AM
Edited Jan 12, 2011 at 4:58 AM

Early today i removed my version of NuGet from ControlPanel->Programs and installed the version on codeplex ('m pretty sure).

 

PM> $host.Version 

Major  Minor  Build  Revision
-----  -----  -----  --------
1      0      11217  102     


PM> 

 

Now, when I try to use the Add Library Package Reference UI I get some massive error screen thingy. So maybe i've fraked up the version in either

1) this solution
2) this computer
3) both.

Developer
Jan 12, 2011 at 5:24 AM

You can't remove NuGet from Control Panel->Programs (It's just a VS extension). Did you mean Mvc 3? What error are you getting?

Jan 12, 2011 at 5:27 AM

there was definately something listed this morning in Control Panel -> Programs .. i'm sure of it. anyway, it's gone now.

here's an example error, when i try to add a nuget reference using the nuget ui (not the PM window) :-

 

ru-roh

 

i'm guessing this is just bad luck to me / bad karma or something :(

Developer
Jan 12, 2011 at 8:13 AM

Oh no, you aren't the first one to see that issue. Did you migrate your project from vs2008 by any chance? Does that happen on a brand new project?

Jan 12, 2011 at 10:04 AM

hmm... i can't remember now. I'm 95% sure it's a vs2010 project that i've had going for around 3 odd months? it's only started doing that ... after i've started mixing nuget versions or something. the first (inital) extension-install had no problems.