Here is my code. What is interesting about the problem is that if I execute the same code in another ASP .Net application or WinForm application it works just fine or at least I do not get the exception. However there is one application in particular where I seem to get the exception repeatedly. Some times it works but fails most of the time. I even tried calling the same code in the ASP .Net Application_Startup before any of my application code gets executed to try isolating the problem but still got the same results. It is becoming a fairly urgent matter. Any help you can provide will be appreciated.
Thanks,
Emeka.
Aspose.BarCode.BarCodeBuilder bb = new Aspose.BarCode.BarCodeBuilder();
I've tested the code posted above and unable to reproduce the problem. Could you give me some code text samples ( the value of barcode_value )? And could you please post the exception call stack? ( Exception.ToString() will do ).
And does this exception always occur, or happen occassionally?
barcode_value is simply a string generated from System.GUID.NewGuid().ToString('N");
I think may have worked once or twice when I tried not setting some properties of the BarcodeBuilder object but I could not diplicate the coimbination of settings that made it work. All in all I get the exception every time. My guess is that memory is being currupted some where in the call to GenerateBarcodeImage(). If it is of any help, I had searched the problem in the Aspose.Word forum and found a similar issue which the Aspose.Word support team attributed to the code being generated by the XenoCode obfuscator.
"System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.\r\n at Aspose.BarCode.BarCodeBuilder.x479874c8b70eab1e()\r\n at Aspose.BarCode.BarCodeBuilder.x3f05e8a79ad985e2()\r\n at Aspose.BarCode.BarCodeBuilder.xd6b4fff0126b3dcb()\r\n at Ctc.ApplicationCentral.Imaging.Barcoding.AsposeProvider.ProviderBase.CreateBarcodeImage(BarcodeFormats format, String barcode_value)\r\n at Ctc.ApplicationCentral.Subscriber.Process.Document.Policies.CreateFaxbackRequestBase.OnExecute() in D:\\Vault\\v0101\\Subscriber\\Process\\Document\\Policies\\CreateFaxbackRequest.cs:line 157" string
1. Are you using the latest release of Aspose.BarCode? If not, could you give it a try?
2. Are you running that sample under .Net 2.0 or .Net1.x? or Compact framework? I suspect there could be a security related problem. Check out if the windows account you are using is a restricted one, or run a anti-virus test. Use a clean machine to run the sample if possible.
Process information: Process ID: 4876 Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE
Exception information: Exception type: AccessViolationException Exception message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Request path: /OneStop/Paperwork.aspx User host address: 192.168.1.15 User: Is authenticated: False Authentication Type: Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information: Thread ID: 6 Thread account name: NT AUTHORITY\NETWORK SERVICE Is impersonating: False Stack trace: at Aspose.BarCode.BarCodeBuilder.x479874c8b70eab1e() at Aspose.BarCode.BarCodeBuilder.x3f05e8a79ad985e2() at Aspose.BarCode.BarCodeBuilder.xd6b4fff0126b3dcb() at Aspose.BarCode.Web.UI.BarCodeWebControl.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Page.Render(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Custom event details:
For more information, see Help and Support Center at https://support.microsoft.com/.
I am using the latest component (2.3.0.0) and I'm using .Net 2.0. The probel I was having was that I kept getting the exception only in one particular application. The same code executed just fine in other sample/test applications.
I finally did find a solution that worked. Since the code will work in other programs/assemblies I decided to move my Barcode generation code from the assembly it was implemented in, to a newly created assembly and it worked. Perhaps the previous assembly'd build settings was corrupt. Anyway, since the move I have yet to experience the problem.
Here’s a debug build of Aspose.BarCode, each line of code from Aspose.BarCode.BarCodeBuilder.x479874c8b70eab1e() is now followed by a debug output statement:
Could you please try out this build and post your output window’s debug informations? By that we can located which line of code threw out that exception.
This debug build was processed with the latest Xeno obfuscator, and 2.3.0.0 was processed using previous versions. We will make a hotfix release shortly then.
I have same problem in Aspose.Word when generate the document. It is working fine in 32bit version of Window 2003 but it throws the Access Violation Exception when i excute the application in II6 and 64bit
Can u help me ASAP?
Thanks,
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.