Saturday, June 21, 2014

AX 2012 R3 Retail POS Error - Microsoft.SqlServer.Types Error - System cannot find the file specified

Issue
You might come across this error when you deploy a standard R3 POS while performing an operation for Getting Product Price, or Adding New Customer, etc essentially any operation that involves sending limited commands to the POS Store DB on another server from the POS machine.




Reason:
On certain occasions you might have a centralized Store DB which is used by all the POS machines and you would not need a offline DB(SQL Express) because you are absolutely sure that the network is always on for the POS. But still the POS requires a minimum of feature pack components for all the operations dll that does DML operations on the store DB.

Some of the impact of these missing SQL components are unable to create new customer(Write to Store DB ) or Calculate Product prices (Pricing Engine) will return zero price.

Resolution:
If you already have a SQL server express then all the necessary components are already covered else the minimum two components of the SQL Server feature pack - SharedManagementObjects.msi and SQLSysCLRTypes.msi

Restart your POS and your Microsoft.SqlServer.Types error will no longer occur and you should be able to see the R3 Retail functionality to work as expected. Hope the post solves someone issue.


Detailed Error Message:

LSRetailPosis.POSProcesses.ProcessInput: System.IO.FileNotFoundException: Could not load file or assembly

'Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its

dependencies. The system cannot find the file specified.
File name: 'Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity,

RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean

forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity,

RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean

forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity,

RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean

forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at System.Data.SqlClient.SqlConnection.ResolveTypeAssembly(AssemblyName asmRef, Boolean throwOnError)
   at System.Data.SqlClient.SqlConnection.<>c__DisplayClass19.<CheckGetExtendedUDTInfo>b__17(AssemblyName asmRef)
   at System.TypeNameParser.ResolveAssembly(String asmName, Func`2 assemblyResolver, Boolean throwOnError, StackCrawlMark&

stackMark)
   at System.TypeNameParser.ConstructType(Func`2 assemblyResolver, Func`4 typeResolver, Boolean throwOnError, Boolean

ignoreCase, StackCrawlMark& stackMark)
   at System.TypeNameParser.GetType(String typeName, Func`2 assemblyResolver, Func`4 typeResolver, Boolean throwOnError,

Boolean ignoreCase, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName, Func`2 assemblyResolver, Func`4 typeResolver, Boolean throwOnError)
   at System.Data.SqlClient.SqlConnection.CheckGetExtendedUDTInfo(SqlMetaDataPriv metaData, Boolean fThrow)
   at System.Data.SqlClient.SqlDataReader.GetValueFromSqlBufferInternal(SqlBuffer data, _SqlMetaData metaData)
   at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
   at System.Data.SqlClient.SqlDataReader.GetValue(Int32 i)
   at Microsoft.Dynamics.Commerce.Runtime.DataModel.CommerceEntity.Populate(SqlDataReader sqlDataReader, TimeZoneInfo

timeZoneInfo)
   at Microsoft.Dynamics.Commerce.Runtime.Data.DatabaseAccessor.ExecuteReader[T](SqlPagedQuery query)
   at Microsoft.Dynamics.Commerce.Runtime.Data.DatabaseAccessor.ExecuteSelect[T](SqlPagedQuery query)
   at Microsoft.Dynamics.Commerce.Runtime.Data.ChannelDatabaseAccessor.GetStoreById(Int64 channelId)
   at Microsoft.Dynamics.Commerce.Runtime.Data.ChannelDataManager.GetStoreById(Int64 channelId)
   at Microsoft.Dynamics.Commerce.Runtime.CommerceRuntime.CreateRequestContext(Request request)
   at Microsoft.Dynamics.Retail.Pos.PriceService.Price.GetPrice(IRetailTransaction retailTransaction)
   at LSRetailPosis.BusinessLogic.ItemSystem.CalculatePriceDiscount(IPosTransaction transaction)
   at LSRetailPosis.BusinessLogic.ItemSystem.CalculatePriceTaxDiscount(IPosTransaction transaction)
   at LSRetailPosis.POSProcesses.ItemSale.Execute()
   at LSRetailPosis.POSProcesses.Operation.RunOperation()
   at LSRetailPosis.POSProcesses.ProcessInput.Execute()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
.


Issue



3 comments:

  1. Dear Praveen,

    I am encountering this error while selecting Product in Price Check, would you mind share any resolution for this, will be appreciated.

    ReplyDelete
  2. thanks a lot it solved my problem

    ReplyDelete
  3. Hello Faheem Ahmed Usmani, Applying atleast the SQL Management objects will help to resolve this error. If worst case can you please try to install the SQL Express on the POS machine to check if the error goes away. Share if you have any logs.


    Hi Ahmed ElDeeb, Thanks for the comment and nice to know the blog helped to resolve your issue.

    ReplyDelete