How to set library to depend on .NET 3.5.1 specifically?

Oct 9, 2010 at 3:56 AM

Hi Guys

NuPack is looking good and I'm just about to finish publishing my first package.

I'm running into an issue because the package is for a Library that requires .NET 3.5 (SP1) aka. 3.5.1 and so v3.5.0 will not work. I've tried specifying the paths below, but none of them work and the "Add-Package" command fails with a "Unable to find assembly references that are compatible with the target framework '.NETFramework,Version=v3.5'" message:

  • lib\NET3.51
  • lib\NET3.5.1

Any ideas?

Thanks in advance
Jaans

Coordinator
Oct 9, 2010 at 4:08 AM

.NET 3.5 is correct. A Service Pack is considered a fix to the current version of the framework. .NET 3.5 SP 1 is still .NET 3.5 (just look in web.config and notice nothing changed) and typically. Typically, after an SP is released, targeting the framework without the SP isn’t supported.

Oct 9, 2010 at 4:34 AM

Thanks Phil

I have updated my package with \lib\NET3.5

Unfortunately, I'm still getting the error message from Add-Package:

_WriteError : Unable to find assembly references that are compatible with the target framework '.NETFramework,Version=v3.5'
At C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\CodePlex Foundation\NuPack Tools\0.1\Scripts\nupack.ps1:107 char:24
+             _WriteError <<<<  $_.Exception
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,_WriteError
 

I have unzipped the .nupkg to tripple check that it's folder is infact "lib\NET3.5".

Only if I change the projects target framework to .NET 4.0 does "Add-Package" work. Strange that the error above is infact referring to .NET 3.5, yet if I choose .NET 3.5 as the target framework for the project it's not happy with it.

Any ideas?

Coordinator
Oct 9, 2010 at 5:19 AM

Could be a bug. Try changing the package to lib\Net20 to see if that works when targeting 3.5.

Phil

From: Jaans [mailto:notifications@codeplex.com]
Sent: Friday, October 08, 2010 9:34 PM
To: Phil Haack
Subject: Re: How to set library to depend on .NET 3.5.1 specifically? [nupack:230233]

From: Jaans

Thanks Phil

I have updated my package with \lib\NET3.5

Unfortunately, I'm still getting the error message from Add-Package:

_WriteError : Unable to find assembly references that are compatible with the target framework '.NETFramework,Version=v3.5'
At C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\CodePlex Foundation\NuPack Tools\0.1\Scripts\nupack.ps1:107 char:24
+ _WriteError <<<< $_.Exception
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,_WriteError

I have unzipped the .nupkg to tripple check that it's folder is infact "lib\NET3.5".

Only if I change the projects target framework to .NET 4.0 does "Add-Package" work. Strange that the error above is infact referring to .NET 3.5, yet if I choose .NET 3.5 as the target framework for the project it's not happy with it.

Any ideas?

Read the full discussion online.

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

To start a new discussion for this project, email nupack@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
Oct 9, 2010 at 5:32 AM

Might be over agressive caching that was fixed after ctp restart VS and see if it still happens.

Coordinator
Oct 9, 2010 at 5:44 AM

Oh yeah! I’ve run into that caching bug before too. J

I think David is suggesting to change your package back to lib\net35 and restart VS before testing it again.

Oct 9, 2010 at 5:46 AM

It's working now, after a restart, cleaning my build and recreating my local path Package Folder.

Thanks for the quick turnaround guys!

Ps: I did initially try a restart of VS, but for some reason it didn't work then - likely a case of PEBCAC (Problem Exists Between Computer And Chair) ;-)

Developer
Oct 9, 2010 at 5:48 AM

Not your fault, our bad for caching so agressively :)