Correct AssemblyName-Profile for Windows Phone 7

Apr 7, 2011 at 3:06 AM

To clarify other bits of documentation, is it "sl4-wp" or is it "sl3-wp" for Windows Phone 7 development as it stands today?

Coordinator
Apr 7, 2011 at 3:09 AM

sl3-wp.

Where did you see sl4-wp?

Apr 7, 2011 at 3:14 AM

Thanks Phil

I saw the following on this page: http://nuget.codeplex.com/discussions/245821

And also on: http://nuget.codeplex.com/documentation?title=Creating%20a%20Package

Jaans


Grouping Assemblies by Framework Profile

NuGet also supports targeting a specific framework profile by appending a dash and the profile name to the end of the folder.

lib\{framework name}-{profile}

For example, to target the Windows Phone profile, place your assembly in a folder named sl3-wp.

Profiles supported by NuGet include:

· Client – Client Profile

· Full – Full Profile

· WP – Windows Phone

At the time of this writing, to target the Windows Phone profile, the Silverlight 4 framework must be specified. It is anticipated that in the future, later versions of Silverlight will be supported on the phone.

Developer
Apr 7, 2011 at 3:45 AM

Fixed

Apr 7, 2011 at 3:49 AM

Thanks all!!

Jun 26, 2011 at 7:29 PM

FYI, this is messed up in NuGet 1.4, combined with NuGet Package Explorer 1.5. When you add a Windows Phone-specific folder in NPE, it adds the folder in lowercase. However, it will not work *at all* using the Mango dev tools beta (but targeting WP 7.0) with the lowercase folder. "SL4-WindowsPhone" is the only string I've determined will work at all.

Did something change between 1.3 and 1.4?

Developer
Jun 26, 2011 at 7:35 PM

What is broken exactly? Mango dev tools have a different framework name.

Jun 26, 2011 at 7:42 PM

Only if you are targeting the Mango release specifically. The Mango dev tools can compile and deploy to both Windows Phone 7.0 and 7.1. What is broken is that I get an error saying it cannot locate an assembly suitable for the profile "Silverlight, Version=v4.0, Profile=WindowsPhone" if the folder name is in all-lowercase. If "SL4" is all-caps it works fine... but that's not what the NuGet Package Explorer creates, and that's not what the spec says.

Developer
Jun 26, 2011 at 7:44 PM

Interesting so concretely the repro steps are:

  1. Create a package with a silverlight assembly and put it in lib/sl4/myassembly.dll
  2. Try to install it in a windows phone 7.0 project (not mango)

And it fails?

Jun 26, 2011 at 7:47 PM

Repro steps:

  1. Create a package with a Windows Phone 7.0 assembly and put it in lib/sl4-WindowsPhone/myassembly.dll.
  2. Try to install it in a Windows Phone 7.0 project (not mango).

The specific error message is: "Unable to find framework assemblies that are compatible with the target framework 'Silverlight,Version=v4.0,Profile=WindowsPhone'." is the exact error message.

Now, go in and change the package to where the assembly is in lib/SL4-WindowsPhone/myassembly.dll and it works just fine.

Developer
Jun 26, 2011 at 7:48 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jun 27, 2011 at 3:37 AM
So is the problem with nuget comparing framework folder with target framework case sensitively?

And shouldn't the framework folder set to SL3-WindowsPhone instead of SL3?

Sent from either Windows Phone or iPhone. You don't know.

From: dfowler
Sent: Sunday, June 26, 2011 12:48 PM
To: Luan Nguyen
Subject: Re: Correct AssemblyName-Profile for Windows Phone 7 [nuget:252880]

From: dfowler

This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Developer
Jul 6, 2011 at 10:38 PM

I couldn't repro this issue, can you attach the package to the bug?