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!