/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;color:#1F497D;
mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA">We try to create a simple console application using Quick OPC .NET product (Version 5.12). The targeted platform is .NET framework 4, there we got “Access denied” error in ItemChanged event. When we try the same application on .NET framework 3.5 it works without any issue. Is “Quick OPC .NET” product support .NET framework 4 ?
<span style="font-size: 11pt; font-family: "Calibri","sans-serif"; color: rgb(31, 73, 125);">class Program
{
static void Main(string[] args)
{
Console.WriteLine("Subscribing for 30 seconds...");
EasyDAClient.DefaultInstance.ItemChanged += new EventHandler(_client_ItemChanged);
EasyDAClient.DefaultInstance.SubscribeItem("ptp-test", "DotNova.DASample.80", "SimulatedData.Sine", 100);
Thread.Sleep(30 * 1000);
Console.WriteLine("Unsubscribing...");
EasyDAClient.DefaultInstance.UnsubscribeAllItems();
Console.WriteLine("Finished.");
}
static void _client_ItemChanged(object sender, EasyDAItemChangedEventArgs e)
{
try
{
Console.WriteLine(e.Vtq.Value.ToString());
}
catch (Exception ex)
{
Console.WriteLine(e.ErrorMessage);
}
}
}