Skip to main content

Notifications

Supply chain | Supply Chain Management, Commerce
Answered

How not to update your references after every Retail SDK upgrade

Posted on by 3,595

If you check sample CRT projects from Retail SDK - you can see that Microsoft does not reference DLL paths directly, there are special placeholders to use, for example: <HintPath>$(PkgMicrosoft_Dynamics_Commerce_Runtime_Framework)\lib\netstandard2.0\Microsoft.Dynamics.Commerce.Runtime.Framework.dll</HintPath>

Where PkgMicrosoft_Dynamics_Commerce_Runtime_Framework comes from Retail SDK configuration

If you follow the same rule, you will not need to update your references after every SDK update

  • Retha Profile Picture
    Retha 1,433 on at
    RE: How not to update your references after every Retail SDK upgrade

    I had to move my CRT projects in the end to RetailSDK for it to pick up the retailPackagePaths file under BuildTools.

    I added all the Import nodes that was on the customer search example under SampleExtensions Commerceruntime, to my projects.

    Thanks for your help Oksana. Upgrades should go from now on a lot more smoother for me.

    I wasn't able to mark your answers that they answered my questions unfortunately.

  • Retha Profile Picture
    Retha 1,433 on at
    RE: How not to update your references after every Retail SDK upgrade

    Oksana, my projects have only 1 import node:

    <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="schemas.microsoft.com/.../2003">

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

    Nowhere in the Retail documentation can I see exactly where I have to save my projects.  Maybe that is the problem.

    So lets start at the beginning.

    1) When I create a CRT project  I do the following:

    File > New -> Project and under Templates I choose Visual C# and then Class Library

    The location where it will save it, is under Visual Studio projects:

    2425.pastedimage1580356469786v1.png

    This is where I would save all my X++ projects and where I continued to save my Retail CRT projects as well. The project file for ClassLibrary2 above will have only that 1 import node.

    I have to upgrade again to the next version. I have found the following link: https://docs.microsoft.com/en-us/dynamics365/retail/dev-itpro/retailsdk-update

    Under "Upgrade the Retail channel extension from 7.3 to a higher version",

    I see it mentions "Commerce runtime (CRT) and retail server (RS) extensions:".

    And in here it almost sounds like my projects are supposed to be saved under the RetailSDK and not under Visual Studio 2015\Projects. 

    and then it sounds like I need to add them to dirs.proj under RetailSDK. Is this correct?

    I did find the definition for each "$PkgMicrosoft_Dynamics_Commerce_Runtime_Entities" in RetailSDK\BuildTools\retailPackagePaths file

  • Verified answer
    Oksana Kovaliova Profile Picture
    Oksana Kovaliova 3,595 on at
    RE: How not to update your references after every Retail SDK upgrade

    Hi, please, check if your project has Import nodes - as shown on picture below.  These nodes make project know what is $PkgMicrosoft_Dynamics_Commerce_Runtime_Entities, etc. 

    6406.project-settings-2.PNG

  • Retha Profile Picture
    Retha 1,433 on at
    RE: MSB3030: Could not copy the file because it was not found URGENT HELP NEEDED

    I've tested this and it is not working for me.

    I created a new class library project and added 2 commerce runtime references. Then I unloaded the project and changed it as follow:

    ***

     <Reference Include="Microsoft.Dynamics.Commerce.Runtime.Entities">

         <HintPath>$(PkgMicrosoft_Dynamics_Commerce_Runtime_Entities)\lib\netstandard2.0\Microsoft.Dynamics.Commerce.Runtime.Entities.dll</HintPath>

       </Reference>

       <Reference Include="Microsoft.Dynamics.Commerce.Runtime.Services.Messages">

         <HintPath>$(PkgMicrosoft_Dynamics_Commerce_Runtime_Services_Messages)\lib\netstandard2.0\Microsoft.Dynamics.Commerce.Runtime.Services.Messages.dll</HintPath>

       </Reference>

       <Reference Include="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">

         <SpecificVersion>False</SpecificVersion>

         <HintPath>$(SdkReferencesPath)\netstandard.dll</HintPath>

       </Reference>

    ***

    Then when I reload the project and rebuild it, I get the yellow triangle for the entities and Service.Messages DLLs. And when I try to use it in the class, it stated that "The type of Namespace 'Dynamics' doesn't exist in the name space 'Microsoft' (Are you missing an assembly reference)"

    Note that it does work for NetStandard.dll. I used StoreHoursSample as the example to see how the HintPath is set for each DLL.

  • Oksana Kovaliova Profile Picture
    Oksana Kovaliova 3,595 on at
    RE: MSB3030: Could not copy the file because it was not found URGENT HELP NEEDED

    You are adding this manually, right. Just click in VS 'Unload project' and 'Edit project file' - and you can edit your references in VS directly.

    You need to do it once and then your solution becomes compatible with all future updates.

  • Retha Profile Picture
    Retha 1,433 on at
    RE: MSB3030: Could not copy the file because it was not found URGENT HELP NEEDED

    How do I add the HintPath?

    If I do a search on file contents on the SampleExtensions folder and look for HintPath then it lists all the projects that uses it. If I open one of those projects I cannot see where it is set.  One of these projects is under CommerceRuntime.StoreHoursSample.

    If I open the project file in NotePad then I can see it. For example:

    ***

    <Reference Include="Microsoft.Dynamics.Commerce.Runtime.Data, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

         <HintPath>$(PkgMicrosoft_Dynamics_Commerce_Runtime_Data)\lib\netstandard2.0\Microsoft.Dynamics.Commerce.Runtime.Data.dll</HintPath>

       </Reference>

       <Reference Include="Microsoft.Dynamics.Commerce.Runtime.DataServices.Messages, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

         <HintPath>$(PkgMicrosoft_Dynamics_Commerce_Runtime_DataServices_Messages)\lib\netstandard2.0\Microsoft.Dynamics.Commerce.Runtime.DataServices.Messages.dll</HintPath>

       </Reference>

    ***

    But in Visual Studio References doesn't have a property option where I can set it. If I look at the properties of the project itself in Visual Studio, then I can't see it there either. The properties of project: StoreHoursSample has an option called "Reference Paths" but what I read about hint paths is that it is different from reference paths.

    So is the only way to add a HintPath by opening my project tin NotePad++ and add it manually?

    By the way, I'm on VS 2015 in case that makes a difference.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans