none
Upgrading LightSwitch Extension Projects to Visual Studio 2013 RRS feed

  • Question

  • Extensibility projects created with the Visual Studio LightSwitch 2012 Extensibility Toolkit can be upgraded to run in Visual Studio 2013 by making a few modifications to the project files.

    Note: Make sure that both the LightSwitch Extensibility Toolkit for Visual Studio 2013 and the Visual Studio 2013 SDK are installed before upgrading your projects.

    Upgrade the Solution

    1. Open the extension solution file in notepad.
    2. At the top of the file change the “# Visual Studio 2011” line to read:

    # Visual Studio 2013
    VisualStudioVersion = 12.0.21005.1
    MinimumVisualStudioVersion = 10.0.40219.1

    Modify the Lspkg Project File

    1. In the ProjectName.Lspkg folder, select the ProjectName.Lspkg.csproj (or .vbproj) file and open it in Notepad.
    2. Change the ToolsVersion in the <Project> tag from “4.0” to “12.0”
    3. Add the following line immediately after the <project> tag:

    <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

    4. Change the TargetFrameworkVersion property from “v4.0”  to “v4.5”
    5. Change the LightSwitchVersion property from “v2.0” to  “v4.0”
    6. Save the file.

    Modify the Client Project File

    1. In the ProjectName.Client folder, select the ProjectName.Client file and open it in Notepad.
    2. At the top of the file change the ToolsVersion in the <Project> tag from “4.0” to “12.0”
    3. Locate the <PropertyGroup> that contains the line:

    <LightSwitchPath Condition=" '$(LightSwitchPath)' == '' ">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0@InstallDir)</LightSwitchPath>

    And replace it with:

    <MicrosoftSdkDir Condition="'$(MicrosoftSdkDir)' == ''">$([System.IO.Path]::Combine($(MSBuildProgramFiles32), 'Microsoft SDKs'))</MicrosoftSdkDir>
    <LightSwitchVersion Condition="'$(LightSwitchVersion)' == ''">v4.0</LightSwitchVersion>
    <LightSwitchSdkPath Condition="'$(LightSwitchSdkPath)' == ''">$([System.IO.Path]::Combine($(MicrosoftSdkDir), 'LightSwitch', $(LightSwitchVersion)))</LightSwitchSdkPath>
    <LightSwitchSdkPath Condition="'$(LightSwitchSdkPath)' != '' and !HasTrailingSlash('$(LightSwitchSdkPath)')">$(LightSwitchSdkPath)\</LightSwitchSdkPath>

    4. Locate the reference to Microsoft.LightSwitch and change the HintPath from
    <HintPath>$(LightSwitchPath)\LightSwitch\Client\Microsoft.LightSwitch.dll</HintPath>
    to
    <HintPath>$(LightSwitchSDKPath)\Client\Microsoft.LightSwitch.dll</HintPath>

    5. Locate the reference to Microsoft.LightSwitch.Client and change the HintPath from
    <HintPath>$(LightSwitchPath)\LightSwitch\Client\Microsoft.LightSwitch.Client.dll</HintPath>
    to
    <HintPath>$(LightSwitchSDKPath)\Client\Microsoft.LightSwitch.Client.dll</HintPath>

    6. Locate the reference to Microsoft.LightSwitch.SdkProxy and change the HintPath from
    <HintPath>$(LightSwitchPath)\LightSwitch\Client\Microsoft.LightSwitch.SdkProxy.dll</HintPath>
    to
    <HintPath>$(LightSwitchPath)\Client\Microsoft.LightSwitch.SdkProxy.dll</HintPath>

    7. Save the file.

    Modify the Client.Design Project File

    1. In the ProjectName.Client.Design folder, select the ProjectName.Client.Design file and open it in Notepad.
    2. At the top of the file change the ToolsVersion in the <Project> tag from “4.0” to “12.0”
    3. Locate the <PropertyGroup> that contains the line:

    <LightSwitchPath Condition=" '$(LightSwitchPath)' == '' ">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0@InstallDir)</LightSwitchPath>

    And replace it with:

    <MicrosoftSdkDir Condition="'$(MicrosoftSdkDir)' == ''">$([System.IO.Path]::Combine($(MSBuildProgramFiles32), 'Microsoft SDKs'))</MicrosoftSdkDir>
    <LightSwitchVersion Condition="'$(LightSwitchVersion)' == ''">v4.0</LightSwitchVersion>
    <LightSwitchSdkPath Condition="'$(LightSwitchSdkPath)' == ''">$([System.IO.Path]::Combine($(MicrosoftSdkDir), 'LightSwitch', $(LightSwitchVersion)))</LightSwitchSdkPath>
    <LightSwitchSdkPath Condition="'$(LightSwitchSdkPath)' != '' and !HasTrailingSlash('$(LightSwitchSdkPath)')">$(LightSwitchSdkPath)\</LightSwitchSdkPath>

    4. Locate the reference to Microsoft.LightSwitch and change the HintPath from
    <HintPath>$(LightSwitchPath)\LightSwitch\Client\Microsoft.LightSwitch.dll</HintPath>
    to
    <HintPath>$(LightSwitchSDKPath)\Client\Microsoft.LightSwitch.dll</HintPath>

    5. Locate the reference to Microsoft.LightSwitch.Client  and change the HintPath from
    <HintPath>$(LightSwitchPath)\LightSwitch\Client\Microsoft.LightSwitch.Client.dll</HintPath>
    to
    <HintPath>$(LightSwitchSDKPath)\Client\Microsoft.LightSwitch.Client.dll</HintPath>

    6. Save the file.

    Modify the Common Project File

    1. In the ProjectName.Common folder, select the ProjectName.Common file and open it in Notepad.
    2. At the top of the file change the ToolsVersion in the <Project> tag from “4.0” to “12.0”
    3. Locate the <PropertyGroup> that contains the line:

    <LightSwitchPath Condition=" '$(LightSwitchPath)' == '' ">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0@InstallDir)</LightSwitchPath>

    And replace it with:

    <MicrosoftSdkDir Condition="'$(MicrosoftSdkDir)' == ''">$([System.IO.Path]::Combine($(MSBuildProgramFiles32), 'Microsoft SDKs'))</MicrosoftSdkDir>
    <LightSwitchVersion Condition="'$(LightSwitchVersion)' == ''">v4.0</LightSwitchVersion>
    <LightSwitchSdkPath Condition="'$(LightSwitchSdkPath)' == ''">$([System.IO.Path]::Combine($(MicrosoftSdkDir), 'LightSwitch', $(LightSwitchVersion)))</LightSwitchSdkPath>
    <LightSwitchSdkPath Condition="'$(LightSwitchSdkPath)' != '' and !HasTrailingSlash('$(LightSwitchSdkPath)')">$(LightSwitchSdkPath)\</LightSwitchSdkPath>

    4. Locate the reference to Microsoft.LightSwitch and change the HintPath from
    <HintPath>$(LightSwitchPath)\LightSwitch\Client\Microsoft.LightSwitch.dll</HintPath>
    to
    <HintPath>$(LightSwitchSDKPath)\Client\Microsoft.LightSwitch.dll</HintPath>

    5. Save the file.

    Modify the Design Project File
    1. In the ProjectName.Design folder, select the ProjectName.Design file and open it in Notepad.
    2. Change the ToolsVersion in the <Project> tag from “4.0” to “12.0”
    3. Add the following line immediately after the <project> tag:

    <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

    4. Change the TargetFrameworkVersion property from “v4.0” to “v4.5”
    5. Locate the <PropertyGroup> that contains the line:

    <LightSwitchPath Condition=" '$(LightSwitchPath)' == '' ">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0@InstallDir)</LightSwitchPath>

    And replace it with:

    <MicrosoftSdkDir Condition="'$(MicrosoftSdkDir)' == ''">$([System.IO.Path]::Combine($(MSBuildProgramFiles32), 'Microsoft SDKs'))</MicrosoftSdkDir>
    <LightSwitchVersion Condition="'$(LightSwitchVersion)' == ''">v4.0</LightSwitchVersion>
    <LightSwitchSdkPath Condition="'$(LightSwitchSdkPath)' == ''">$([System.IO.Path]::Combine($(MicrosoftSdkDir), 'LightSwitch', $(LightSwitchVersion)))</LightSwitchSdkPath>
    <LightSwitchSdkPath Condition="'$(LightSwitchSdkPath)' != '' and !HasTrailingSlash('$(LightSwitchSdkPath)')">$(LightSwitchSdkPath)\</LightSwitchSdkPath>

    6. Locate the reference to Microsoft.LightSwitch and change the HintPath from
    <HintPath>$(LightSwitchPath)\LightSwitch\Client\Microsoft.LightSwitch.dll</HintPath>
    to
    <HintPath>$(LightSwitchSDKPath)\Client\Microsoft.LightSwitch.dll</HintPath>

    7. Locate the reference to Microsoft.LightSwitch.Design.Designer replace it with

    <Reference Include="Microsoft.LightSwitch.Design.Designer">
    <HintPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\LightSwitch\$(LightSwitchVersion)\Microsoft.LightSwitch.Design.Designer.dll</HintPath>
    <Private>False</Private>
    </Reference>

    8. Locate the reference to Microsoft.LightSwitch.Model.Xaml and replace it with 

    <Reference Include="Microsoft.LightSwitch.Model.Xaml">
    <HintPath>$(LightSwitchSdkPath)\Server\Microsoft.LightSwitch.Model.Xaml.dll</HintPath>
    <Private>False</Private>
    </Reference>

    9. Add the following reference immediately after the reference to Microsoft.LightSwitch:   

    <Reference Include="Microsoft.LightSwitchExportProvider">
    <HintPath>$(LightSwitchSdkPath)\Client\Microsoft.LightSwitch.ExportProvider.dll</HintPath> 
    <Private>False</Private>   
    </Reference>

    10. Save the file.

    Modify the Server Project File

    1. In the ProjectName.Server folder, select the ProjectName.Server file and open it in Notepad.
    2. Change the ToolsVersion in the <Project> tag from “4.0” to “12.0”
    3. Add the following line immediately after the <project> tag:

    <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

    4. Change the TargetFrameworkVersion property from “v4.0” to “v4.5”
    5. Locate the <PropertyGroup> that contains the line:

    <LightSwitchPath Condition=" '$(LightSwitchPath)' == '' ">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0@InstallDir)</LightSwitchPath>

    And replace it with:

    <MicrosoftSdkDir Condition="'$(MicrosoftSdkDir)' == ''">$([System.IO.Path]::Combine($(MSBuildProgramFiles32), 'Microsoft SDKs'))</MicrosoftSdkDir>
    <LightSwitchVersion Condition="'$(LightSwitchVersion)' == ''">v4.0</LightSwitchVersion>
    <LightSwitchSdkPath Condition="'$(LightSwitchSdkPath)' == ''">$([System.IO.Path]::Combine($(MicrosoftSdkDir), 'LightSwitch', $(LightSwitchVersion)))</LightSwitchSdkPath>
    <LightSwitchSdkPath Condition="'$(LightSwitchSdkPath)' != '' and !HasTrailingSlash('$(LightSwitchSdkPath)')">$(LightSwitchSdkPath)\</LightSwitchSdkPath>

    6. Locate the reference to Microsoft.LightSwitch and change the HintPath from
    <HintPath>$(LightSwitchPath)\LightSwitch\Client\Microsoft.LightSwitch.dll</HintPath>
    to
    <HintPath>$(LightSwitchSDKPath)\Client\Microsoft.LightSwitch.dll</HintPath>

    7. Locate the References for System.ServiceModel.DomainServices.Hosting  and System.ServiceModel.DomainServices.Server and remove the Version, Culture, PublicKeyToken and ProcessorArchitecture attributes.

    8. Save the file.

    Modify the VSIX Project File

    1. In the ProjectName.VSIX folder, select the ProjectName.Vsix.csproj (or vbproj) file and open it in Notepad.
    2. Change the ToolsVersion in the <Project> tag from “4.0” to “12.0”
    3. Change the MinimumVisualStudioVersion from “11.0” to “12.0”
    4. Save the file.

    Performing these steps will upgrade your extension project. Now you can open the solution in Visual Studio 2013 and upgrade the manifest to support version 12.0:

    <Installation>
        <
    InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[11.0,12.0]" />
      </
    Installation>


    Senior Program Manager, Visual Studio Community http://www.bethmassi.com http://msdn.com/lightswitch http://dev.office.com


    Thursday, October 17, 2013 11:48 AM

All replies

  • For some reason, now I can reply to this thread (couldn't earlier), so I can thank you for this great step-by-step walkthrough!

    Keep up the great work, Beth!

    Keep rocking LS

    Jan


    It's your story - time to switch on the innovation.||About me||LightSwitch blog

    Saturday, January 25, 2014 5:45 PM
  • Hi Beth

    there are now two weeks that I try in vain to find a way to manage the control ManyToMany in lightswitch 2013.
    Here https://skydrive.live.com/redir?resid=3B587C1388F39205!519

    I have put the entire project changed as you suggested but it does not work compilation.

    The errors are incorrect references that the project has to Lspkg projects and then compile fails.
    The same error was opening a new extension project.
    I have already asked the question but no answer 
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/59a86b9e-ba25-4b7f-9880-3ca96d2fa1bd/vs-2013-lightswitch-extension-toolkit-project-template-errors?forum=lsextensibility
    http://janvanderhaegen.com/2011/12/26/dealing-with-the-famous-error-the-following-references-require-lightswitch-package-designations/#comment-6915
    https://social.msdn.microsoft.com/Forums/vstudio/it-IT/2bd87dbc-dc1d-4b11-80dd-0a6ac1e8b91c/errata-creazione-progetto-lightswitch-extension-library?forum=vstfsit
    Help me please.

    Vanni

    Tuesday, October 21, 2014 4:44 PM
  • Using VS15 and getting this error.

    2>Done building project "xxxxxx_LightSwitchHTML.lsxtproj" -- FAILED.

    So editing the files listed above won't be a solution for me.

    Tuesday, August 23, 2016 8:48 PM
  • If you use HTML client I suggest you this reading: 
    https://blogs.msdn.microsoft.com/lightswitch/2013/04/10/many-to-how-many-html-edition-heinrich-wendel/

    Vanni
    Thursday, August 25, 2016 1:21 PM