DotNet DataType Unable to create Instance

coheedramos
Member Posts: 6
Hello Guys, I created a DLL using C# with .Net framework 4.0 and I have also deployed it in the add-ins folder on both client and server folder. However, it still prompts me the message "Cannot create an instance of the following .Net Framework. . ." (Please see the image). What am I missing? I am using Microsoft Dynamics NAV 2013 R2.
This is working fine when I change the DotNet datatype's property RunOnClient to True, but this is asking to "allow the extension. . ." for every session. I wanted to just run this on server only because I am using it also in the Job Queue. Please help.
Looking forward for your response.
Heres my C# and C/AL Code:
C#:
[Serializable]
public class Processor: ISerializable
{
[NonSerialized]
string postData;
public string PostData
{
get { return postData; }
set { postData = value; }
}
public Processor()
{
PostData = string.Empty;
}
public static string testMessage()
{
return "test";
}
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue(postData, this.PostData);
}
public List<MembershipCard> BlockedMembershipCardList(string serviceUrl)
{
Bridge bridge = new Bridge(serviceUrl);
return bridge.GetBlockedMembershipCards();
}
public DataTable BlockedMembershipCardDataTable(string serviceUrl)
{
Bridge bridge = new Bridge(serviceUrl);
DataTable a = bridge.GetBlockedMembershipCardsAsDatatable();
return bridge.GetBlockedMembershipCardsAsDatatable();
}
public MembershipCard MemberShipInformation(string serviceUrl, string cardNumber)
{
Bridge bridge = new Bridge(serviceUrl);
return bridge.GetMembershipCard(cardNumber);
}
public MembershipCard PostTransactionsToWeb(string serviceurl, string _data)
{
Bridge bridge = new Bridge(serviceurl);
return bridge.PushTransactionToWeb(_data.TrimEnd('&').Replace(@\r\n, " ").Replace(" ", "%20"));
}
public MembershipCard PostTransactionsToWeb(string serviceurl)
{
Bridge bridge = new Bridge(serviceurl);
return bridge.PushTransactionToWeb(PostData.TrimEnd('&').Replace(@\r\n, " ").Replace(" ", "%20"));
}
public Status ValidateCouponCard(string serviceUrl, string memberCard, string couponCard)
{
Bridge bridge = new Bridge(serviceUrl);
return bridge.ValidateCouponCard(memberCard,couponCard);
}
public string md5(string rawString)
{
Bridge b = new Bridge();
return b.StringToMd5(rawString);
}
public bool CheckConnectivity(string url)
{
try
{
using (var client = new WebClient())
using (var stream = client.OpenRead(url))
{
return true;
}
}
catch
{
return false;
}
}
}
C/AL:
LoyaltyIntegration := LoyaltyIntegration.Processor;
blockedCardData := LoyaltyIntegration.BlockedMembershipCardDataTable(PosFuncProfile."LOY Web Service Uri");
recLoyBlockedCards.INIT;
recLoyBlockedCards.RESET();
recLoyBlockedCards.DELETEALL;
FOR rowCtr := 0 TO blockedCardData.Rows.Count - 1 DO BEGIN
recLoyBlockedCards."Card Number" := blockedCardData.Rows.Item(rowCtr).Item(0);
recLoyBlockedCards."Block Type" := blockedCardData.Rows.Item(rowCtr).Item(1);
recLoyBlockedCards.INSERT;
END;
The error occurs upon Initializing the LoyaltyIntegration;
This is working fine when I change the DotNet datatype's property RunOnClient to True, but this is asking to "allow the extension. . ." for every session. I wanted to just run this on server only because I am using it also in the Job Queue. Please help.
Looking forward for your response.

Heres my C# and C/AL Code:
C#:
[Serializable]
public class Processor: ISerializable
{
[NonSerialized]
string postData;
public string PostData
{
get { return postData; }
set { postData = value; }
}
public Processor()
{
PostData = string.Empty;
}
public static string testMessage()
{
return "test";
}
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue(postData, this.PostData);
}
public List<MembershipCard> BlockedMembershipCardList(string serviceUrl)
{
Bridge bridge = new Bridge(serviceUrl);
return bridge.GetBlockedMembershipCards();
}
public DataTable BlockedMembershipCardDataTable(string serviceUrl)
{
Bridge bridge = new Bridge(serviceUrl);
DataTable a = bridge.GetBlockedMembershipCardsAsDatatable();
return bridge.GetBlockedMembershipCardsAsDatatable();
}
public MembershipCard MemberShipInformation(string serviceUrl, string cardNumber)
{
Bridge bridge = new Bridge(serviceUrl);
return bridge.GetMembershipCard(cardNumber);
}
public MembershipCard PostTransactionsToWeb(string serviceurl, string _data)
{
Bridge bridge = new Bridge(serviceurl);
return bridge.PushTransactionToWeb(_data.TrimEnd('&').Replace(@\r\n, " ").Replace(" ", "%20"));
}
public MembershipCard PostTransactionsToWeb(string serviceurl)
{
Bridge bridge = new Bridge(serviceurl);
return bridge.PushTransactionToWeb(PostData.TrimEnd('&').Replace(@\r\n, " ").Replace(" ", "%20"));
}
public Status ValidateCouponCard(string serviceUrl, string memberCard, string couponCard)
{
Bridge bridge = new Bridge(serviceUrl);
return bridge.ValidateCouponCard(memberCard,couponCard);
}
public string md5(string rawString)
{
Bridge b = new Bridge();
return b.StringToMd5(rawString);
}
public bool CheckConnectivity(string url)
{
try
{
using (var client = new WebClient())
using (var stream = client.OpenRead(url))
{
return true;
}
}
catch
{
return false;
}
}
}
C/AL:
LoyaltyIntegration := LoyaltyIntegration.Processor;
blockedCardData := LoyaltyIntegration.BlockedMembershipCardDataTable(PosFuncProfile."LOY Web Service Uri");
recLoyBlockedCards.INIT;
recLoyBlockedCards.RESET();
recLoyBlockedCards.DELETEALL;
FOR rowCtr := 0 TO blockedCardData.Rows.Count - 1 DO BEGIN
recLoyBlockedCards."Card Number" := blockedCardData.Rows.Item(rowCtr).Item(0);
recLoyBlockedCards."Block Type" := blockedCardData.Rows.Item(rowCtr).Item(1);
recLoyBlockedCards.INSERT;
END;
The error occurs upon Initializing the LoyaltyIntegration;
0
Best Answers
-
Since the NST is 64 bit, try creating your DLL as a 64 bit DLL and see if that works. There was a very similar issue recently and this was resolved by placing a 64 bit version of the DLL in the Add-ins folder under the Service folder.5
-
No problem! You only need the RTC add-ins version on the machines where you are developing with the Development Environment5
Answers
-
Since the NST is 64 bit, try creating your DLL as a 64 bit DLL and see if that works. There was a very similar issue recently and this was resolved by placing a 64 bit version of the DLL in the Add-ins folder under the Service folder.5
-
Fuck!!! it works like a fucking charm! you holy grace from above!
Just to add. . . Does mean that I have to deploy a 2 separate build of my dll x86 and 64bit?0 -
Thank you man!0
-
No problem! You only need the RTC add-ins version on the machines where you are developing with the Development Environment5
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions