Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Commerce forum / Problem with dll *.Run...
Commerce forum
Under review by Community Managers

Under review

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

Problem with dll *.Runtime.DataAccess.SqlServer

Posted on by 29
Hi,
 
I'm targeting 'netstandard2.0' and I have a C# class (present in the hardwarestation project) where I want to execute a stored procedure on the database. I'm using the below piece of code:
 
using (var databaseContext = new Microsoft.Dynamics.Commerce.Runtime.DataAccess.SqlServer.SqlServerDatabaseContext(request.RequestContext))
{
    Microsoft.Dynamics.Commerce.Runtime.ParameterSet parameters = new Microsoft.Dynamics.Commerce.Runtime.ParameterSet();
    
    parameters["@DAYS"] = 90;
    await databaseContext.ExecuteStoredProcedureNonQueryAsync("[ext].[ExternalGiftCardLogPurge]", parameters, resultSettings: null).ConfigureAwait(false);
}
 
 
In my project file I have the following:
 
<PackageReference Include="Microsoft.Dynamics.Commerce.Runtime.DataAccess.SqlServer" Version="9.48.24158.2" />
 
 
When I run the Store Commerce app and test this, I get the following error message:
 
Could not load file or assembly 'Microsoft.Dynamics.Commerce.Runtime.DataAccess.SqlServer, Version=7.0.0.0, Culture=neutral, 
 
 
When I put the same code in a CommerceRuntime trigger (e.g. 'PurgeSalesTransactionsDataRequest') then it runds fine.
 
Anyone have an idea how to solve this? I don't even understand why it is asking for version 7.0.0.0 because this version is not even available in NuGet.
 
Hope someone can point me in the right direction.
 
 
 
 

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans