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
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.
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:
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
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.
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.
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.
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156