Dealing with the error: “the following references require LightSwitch package designations”

With any website or blog, it’s always interesting to see how people reached your site.  Lately, it seems that more and more people reach my blog by Googling “the following references require LightSwitch package designations”.  This one is for you…

What did you do to cause this error?

You created a LightSwitch extension. Awesome! On a side note, I hope you know you can use Extensions Made Easy to help you debug! 🙂

When you create a new LightSwitch extension, Visual Studio will add 5 projects to the solution for you, one LSPKG project, and one VSIX project.  The LSPKG project references the 5 projects by default, and you added an extra reference (either an external DLL or a new project that you added to the solution).

What does this error mean?

The LightSwitch framework needs to know what to do with the references that you added to the LSPKG project, once your extension is installed and activated in a LightSwitch application.  It seems to already know about the 5 default packages: MyNewExtension.Client will be added as a reference to your LightSwitch application Client project, MyNewExtension.Client.Design will be used by Visual Studio at design time, …

It doesn’t know what you want to happen to the reference that you added.  It requires a “designation” for your “LightSwitch package”.

How can you fix it?

In the solution explorer, right-click your LSPKG project and select “Unload project”.

It will be grayed out and “temporary unavailable”.  Right click it again and select “Edit MyNewExtension.Lspkg.csproj”.

You will see a xml file, and the answer to your problem is found at the bottom of that file.

You can see the ProjectReferences here that match the references of your LSPKG project.  Notice the tags, underlined in blue, which your ProjectReference is missing, those are “LightSwitch package desitinations”…  Add the one that seems like the one you need (LspkgClientContent, LspkgIDEContent or LspkgServerContent), save and close the xml file and right-click on the LSPKG project in your solution explorer to reload it.

Enjoy your LightSwitch extension!

Advertisements

3 thoughts on “Dealing with the error: “the following references require LightSwitch package designations”

  1. Pingback: Windows Azure and Cloud Computing Posts for 12/26/2011+ - Windows Azure Blog

  2. Hello Jan,
    You’re my last hope…
    I had the exact same problem in lighswitch for visual studio 2013 but I did not understand your suggestion. This is an extract of my file and I do not understand what I’m supposed to correct.

    {14a95e60-9af4-48ad-95e9-6deacd5930e6}
    ManyToManyControls.Client.Design

    {497ed5f3-7bc8-4a9a-9cda-e40dbcdf8d28}
    ManyToManyControls.Client

    {921684e8-49d5-4eaa-a5be-3e83dcbab5d9}
    ManyToManyControls.Common

    ManyToManyControls.Design
    true

    ManyToManyControls.Server
    true

    Further down there is a double reference to Microsoft.VisualBasic.targets, Why?
    Microsoft engineers have not been able to point to any solution.:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/59a86b9e-ba25-4b7f-9880-3ca96d2fa1bd/vs-2013-lightswitch-extension-toolkit-project-template-errors?forum=lsextensibility

    Please help me.
    John

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s