When trying to add the current “Microsoft.AspNet.WebApi.OData” to a LightSwitch project I got the following error message:
Install-Package "Microsoft.AspNet.WebApi.OData" -Verbose Could not install package 'Microsoft.AspNet.WebApi.Client 5.2.0'. You are trying to install this package into a project that targets 'Silverlight,Version=v5.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
We are not using Silverlight in our application, only the HTML client – except when doing user and role administration …
As a matter of fact we only need the package on the server layer anyway. So the solution to this is to install the package only to the “Server” project within the solution of the application (excluding the HTML and SilverLight client).
# target installation to LightSwitch server project only Install-Package "Microsoft.AspNet.WebApi.OData" -Verbose -ProjectName "LSAppProject.Server";