NotSupportedException in VS2010

NotSupportedException in VS2010

Forum member · Aug 24, 2010
I am trying to generate an Invoice document in ASP.NET (Visual Basic) - populating fields from a data service - using Gnereator v4 in Visual Studio 2010. The final line ... MyDocument.DrawToWeb("Invoice.pdf") ... errors with the following error: System.TypeInitializationException: The type initializer for 'zz93.av' threw an exception. ---> System.NotSupportedException: The invoked member is not supported in a dynamic assembly. at System.Reflection.Emit.InternalAssemblyBuilder.GetManifestResourceNames() at zz93.av.a() at zz93.av..cctor() I have reduced the complexity of the code until the error goes away and it is apparent that this error is associated with data retrieval. There is no error if I hard code the data that goes into the pdf. I am currently trying to see if I can put the data into session state from the previous page and work around that way. Is this a .NET 4.0 issue - I have not had trouble before?

Re: NotSupportedException in VS2010

Forum member · Aug 24, 2010
OK - posting the data to session state in the previous page and then accessing it to poputae the Invoice pdf works. This is fine for a small web site, but on a big busy one the quantitiy of data saved to session state could be an issue.

Re: NotSupportedException in VS2010

Support · Aug 24, 2010
Hello, We did test the v4 product with VS2010 and we are able to run the application without any problem. We can use the v4 with VS2010 without any problem. Thanks, ceTe Software Support Team.

Re: NotSupportedException in VS2010

Forum member · Aug 25, 2010
Thank you for the quick reply. The bug is more weird than I thought - getting data from an external source was not the issue, just coincidental. It seems to have something to do with editing the code that generates the pdf, and is not 100% repeatable. If I rebuild the project before running it the error goes away (temporarily) but reappears after further code editing. The error is always thrown on the line ... MyDocument.DrawToWeb("Invoice.pdf"). The full error string is shown below. Any thought you have on this will be most welcome - the zz93 stuff must be inside the CeTe modules. System.TypeInitializationException: The type initializer for 'zz93.av' threw an exception. ---> System.NotSupportedException: The invoked member is not supported in a dynamic assembly. at System.Reflection.Emit.InternalAssemblyBuilder.GetManifestResourceNames() at zz93.av.a() at zz93.av..cctor() --- End of inner exception stack trace --- at zz93.av.c(Int32 A_0) at ceTe.DynamicPDF.Document.f() at ceTe.DynamicPDF.Page.DrawEntries(DocumentWriter writer, Int32 pageNumber, Int32 sectionPageNumber) at ceTe.DynamicPDF.Page.a(DocumentWriter A_0, Int32 A_1, Int32 A_2, Int32 A_3) at zz93.aa.d(Int32 A_0) at zz93.aa.v() at ceTe.DynamicPDF.Document.a(HttpRequest A_0, HttpResponse A_1, Boolean A_2, String A_3, Boolean A_4) at ceTe.DynamicPDF.Document.DrawToWeb(Boolean allowBrowserCaching, String downloadAsFileName, Boolean forceDownload) at ceTe.DynamicPDF.Document.DrawToWeb(String downloadAsFileName) at Invoice.Page_Load(Object sender, EventArgs e) in C:\DEVELOPER\TShopWeb\Invoice.aspx.vb:line 74

Re: NotSupportedException in VS2010

Support · Aug 25, 2010
Hello, We have not seen any issues of this kind. Can you please try using the latest build of our v4 product? Please send an email to our [^a|mailto:support@cete.com|Support Team^] so that they can give you the latest build dlls. Thanks, ceTe Software Support Team.

Re: NotSupportedException in VS2010

Forum member · Oct 14, 2010
?????ceTe.DynamicPDF.40.dll???????????,???ceTe.DynamicPDF.20.dll????????? ?Document.Draw("C:\ss.pdf") Error Body: System.Web.HttpException (0x80004005) ---> System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.TypeInitializationException: The type initializer for 'zz93.a5' threw an exception. ---> System.NotSupportedException: The invoked member is not supported in a dynamic assembly. at System.Reflection.Emit.InternalAssemblyBuilder.GetManifestResourceNames() at zz93.a5.a() at zz93.a5..cctor() --- End of inner exception stack trace --- at zz93.a5.c(Int32 A_0) at ceTe.DynamicPDF.Page.DrawEntries(DocumentWriter writer, Int32 pageNumber, Int32 sectionPageNumber) at ceTe.DynamicPDF.Page.a(DocumentWriter A_0, Int32 A_1, Int32 A_2, Int32 A_3) at zz93.ak.d(Int32 A_0) at zz93.ak.x() at ceTe.DynamicPDF.Document.Draw(Stream stream) at ceTe.DynamicPDF.Document.Draw(String filePath) ?????????!!!!

Re: NotSupportedException in VS2010

Support · Oct 14, 2010
Hello, If you are having this problem in VS2010, can you please make sure that you are using the .NET Framework v4.0 instead of the Client Profile for the project? What build of our dll are you using and can you please send over a sample application which is giving this error to our [^a|mailto:support@cete.com|Support Team^] so that they can look into it further? Thanks, ceTe Software Support Team.

Re: NotSupportedException in VS2010

Forum member · Oct 19, 2010
Hello, Thank you for helping me! I have no problem in VS2010, but in VS2008, using the Net FrameWork 2, run the program, there could not open the PDF document format, the wrong question. How can I solve? Thank you!

Re: NotSupportedException in VS2010

Support · Oct 20, 2010
Hello, You will have to use the ceTe.DynamicPDF.20.dll when working with framework v2.0. We have not seen any issues with the .NET framework v2.0 and VS2008. Are you trying to merge any existing PDF documents? If so please send over the PDF document and the code you are using to our [^a|mailto:support@cete.com|Support Team^] so that they can look into it further. Thanks, ceTe Software Support Team.

Re: NotSupportedException in VS2010

Forum member · Feb 22, 2011
Hi, We purchased the DynamicPDFRasterizer licenses a year ago. Back then, the package only contains up to v3.5. Now, we have the need to get the v4.0 version. Do we have to purchase a different license or can we just download it?

Re: NotSupportedException in VS2010

Support · Feb 22, 2011
Hello, This thread is for DynamicPDF Generator v4.0 which does not support .NET framework v4.0. Generator v4.0 supports until .NET Framework v2.0 and support for .NET 3.5 and 4.0 is added to Generator v6.0 which is the current version. Regarding the DynamicPDF Rasterizer v1.0 which is the current version you can get the .NET v4.0 dll by downloading the latest build. The latest build is available in the customer area when you login using the product serial number. For people who are still evaluating the DynamicPDF Rasterizer it can be downloaded at: http://www.DynamicPDF.com/Products/DynamicPDFRasterizerforNET/Download.csp Thanks, ceTe Software Support Team.

Re: NotSupportedException in VS2010

Forum member · Feb 23, 2011
Hi, This is my code to create PDF report. Imports Microsoft.VisualBasic Imports ceTe.DynamicPDF Imports ceTe.DynamicPDF.PageElements Public Class Test Public Sub CreatePDFReport() Dim i, j As Integer Dim table As Table = New Table(0, 0, 500, 500) For i = 1 To 5 table.Columns.Add(100) Next For i = 1 To 20 Dim row As Row = table.Rows.Add(15, Font.Helvetica, 8) For j = 1 To 5 row.Cells.Add("row:" & i.ToString() & "& cell:" & j.ToString()) Next Next Dim page As Page = New Page(PageSize.Legal,PageOrientation.Portrait) page.Elements.Add(table) Dim document As Document = New Document document.Pages.Add(page) document.DrawToWeb() End Sub End Class Why does the report stall show a watermark? " Evaluating unlicensed DynamicPDF feature. Click here for details. [1:0:v6.0",but I have installed the regarding the DynamicPDF Rasterizer v1.0 which is the current version you can get the .NET v4.0 dll. So how do I deal with it? Thank you!

Re: NotSupportedException in VS2010

Support · Feb 24, 2011
Hello, The numbers [1:0:v6.0] shows that you are using version 6 DynamicPDF dll file with version 4 DynamicPDF license key in your application. In order to remove the watermark you will need to make sure that you are using version 4 DynamicPDF dll file with version 4 DynamicPDF license key or you will have to upgrade your current version 4 license to version 6 to use the version 6 features of DynamicPDF API. The latest version 6 DynamicPDF Generator for .NET product has separate dll file which you can use in applications which will target version 4 .NET framework. Thanks, ceTe Software Support Team.

Re: NotSupportedException in VS2010

Forum member · Jul 12, 2011
Hi im getting this exception when trying to create a pdf file: System.TypeInitializationException: The type initializer for 'zz93.db' threw an exception. ---> System.NotSupportedException: The invoked member is not supported in a dynamic assembly. at System.Reflection.Emit.InternalAssemblyBuilder.GetManifestResourceNames() at zz93.db.a() at zz93.db..cctor() at ceTe.DynamicPDF.Document.AddLicense(String licenseKey) im running a web application over framework 4.0 with ceTe.DynamicPDF.11.dll please advise

Re: NotSupportedException in VS2010

Support · Jul 13, 2011
Hello, The version 4 DynamicPDF does not have support for version 4.0 .NET framework. You will need to change the target framework to 2.0 and reference the ceTe.DynamicPDF.20.dll in your application and this should work for you. If you want to target version 4.0 .NET framework then you can use our latest version 6 DynamicPDF Generator for .NET and reference ceTe.DynamicPDF.40.dll in your application and this will work for you. You can download the latest evaluation edition of version 6 DynamicPDF Generator for .NET product from our website at: http://www.DynamicPDF.com/Products/DynamicPDFForNET/Generator/Download.csp . Thanks, ceTe Software Support Team.

Re: NotSupportedException in VS2010

Forum member · Jul 13, 2011
I have solutions targeting frameworks 1.1 and 4.0 if i buy the newest version of dynamic pdf generator, will it work for both frameworks?

Re: NotSupportedException in VS2010

Support · Jul 13, 2011
Hello, The latest version of DynamicPDF Generator is v6.0 and it supports .NET Frameworks 2.0, 3.0, 3.5 and 4.0. It does not support .NET 1.1. v5.0 of DynamicPDF Generator supports .NET 1.1, 2.0, 3.0 & 3.5. Thanks, ceTe Software Support Team.

Re: NotSupportedException in VS2010

Forum member · Sep 21, 2011
I am running DynamicPDF v4.0.3.20. We recently upgraded to VS2010 and all projects to target framework 4.0. I tested locally and everything worked fine. I published and all generation works fine on MY machine only running the live app. The rest of the users throughout our company that utilize the app have the "type initializer" error mentioned in the previous posts. Please help me determine what could be different on my machine that would allow me to generate using v4 of your product targeting .Net framework 4? The previous moderator posts indicate that it is a compatibility issue and an upgrade to v6 of your product is a solution. However, this can't be the issue if I am able to generate documents without a problem. I've gone so far as to copy my installed app to another computer in our network and the generation fails. This leads me to believe that I have something installed that others do not. Are there any dependencies that I may not be aware of?

Re: NotSupportedException in VS2010

Support · Sep 21, 2011
Hello, The DynamicPDF v4.0.3.20 dll you are using is not intended to be used with .NET Framework v4.0 projects, it can only be used with .NET Framework v2.0 projects. If you use it with .NET 4.0 it may or may not work all the time and might behave erratically. The only dependency you need to use DynamicPDF dll in your project is that you need to have the appropriate .NET Framework version installed there are no other dependencies. Please refer to this link regarding referencing the assemblies in your project for DynamicPDF v4.0.3. If your application is targeting .NET 4.0 you would need to use DynamicPDF v6.0. Thanks, ceTe Software Support Team.

Re: NotSupportedException in VS2010

Forum member · Sep 22, 2011
I'm now using a 4.0 project that has a file reference to a 2.0 targeted class library that does the generation using v4 of your product. Again, it works consistently only on my machine (debug or published), but on anyone else's computer it gives the "type initializer" error within the Draw() method of the document. Would you also confirm that this scenario can produce "erratic" behavior? I am having trouble understanding why I do not have the problem and everyone else does. I've put together a sample application that uses a 4.0 target project and library and ran it on others' computers with success. Could the "type initializer" exception have any other causes that you are aware of?

Re: NotSupportedException in VS2010

Forum member · Sep 22, 2011
UPDATE: We found the problem and a potential workaround for anyone who may be interested. Our application that was having the problem with the "type initializer" exception was utilizing dynamic assembly creation for a separate process. Apparently, if the dynamic assembly creation was hit first, the Draw() method would fail every time. Our solution was to call the Draw() method (no parameters and essentially did nothing) in our startup form. For the life of the application after that, no more generation errors were encountered. For the record, we are running a framework 4 project and using v4 of DynamicPDF. We use a multitude of different elements within the generation application including formatted text areas, barcodes, layout grids, etc. Hopefully, the support staff can shed some light on the dynamic assembly problem.

Re: NotSupportedException in VS2010

Support · Sep 22, 2011
Hello, You could continue using the workaround but DynamicPDF v4.0 is not officially supported for .NET 4.0 as it is intended to be used with .NET versions 1.0, 1.1 & 2.0 . If you want the DynamicPDF v4.0 dll (ceTe.DynamicPDF.20.dll) to work consistently on all the computers you would need to set the target framework to .NET 2.0 in your project and have .NET Framework 2.0 installed on all the computers it is deployed to. If your application has to target .NET 4.0 you would need to use DynamicPDF v6.0 which supports .NET Frameworks 2.0, 3.5 & 4.0 . Thanks, ceTe Software Support Team.

Re: NotSupportedException in VS2010

Forum member · Sep 1, 2014
document.DrawToWeb() method is not working why it only document.Draw() is available,i need the functionality to ask for pdf save using cete.dynamicpdf dll

Re: NotSupportedException in VS2010

Support · Sep 2, 2014
Hello, Can you please give us the following details so that we can look into it further? 1.Are you using DynamicPDF Generator API in Web or Windows applications? 2.If you are getting error then full error message along with stack trace. 3.Exact version and build number of the DynamicPDF DLL file. You can get this information in DLL references properties (Version and Description fields) in Visual Studio. Thanks, ceTe Software support Team.

Error in Dynamic Assembly

Forum member · Feb 22, 2016
The invoked member is not supported in a dynamic assembly. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NotSupportedException: The invoked member is not supported in a dynamic assembly. Source Error: Line 51: Response.Write("Error: " & sErrorMessage) Line 52: Else Line 53: doc.DrawToWeb(Session("MemberID") & "_" & dgt.FileName, False) Line 54: End If Line 55: Source File: D:\APPS\Test_Potability\frames\docGen\dbRetrieve.aspx Line: 53 Stack Trace: [NotSupportedException: The invoked member is not supported in a dynamic assembly.] System.Reflection.Emit.InternalAssemblyBuilder.GetManifestResourceNames() +68 zz93.aw.a() +377 zz93.aw..cctor() +375 [TypeInitializationException: The type initializer for 'zz93.aw' threw an exception.] Microsoft.VisualBasic.CompilerServices.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) +1566696 Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure) +343 Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn) +163 ASP.frames_docgen_dbretrieve_aspx.Page_Load(Object sender, EventArgs e) in D:\APPS\Test_Potability\frames\docGen\dbRetrieve.aspx:53 System.Web.UI.Control.LoadRecursive() +71 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178

Re: NotSupportedException in VS2010

Support · Mar 22, 2016
Hello, System.NotSupportedException is thrown when the .NET Framework version of the application does not match that of the DynamicPDF dll used. Every DynamicPDF dll provided with our product targets a specific .NET Framework. DynamicPDF v4 supports .NET Frameworks 1.0, 1.1 & 2.0 and the latest version (v8) supports .NET 2.0, 3.x & 4.x . If your application is targeting .NET 4.0 or higher we recommend v8. Thanks, ceTe Software Support Team.