web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
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
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 > Commerce

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans