我试图从中使用这个例子,说明如何为文本模板生成创建一个自定义主机。file //If the directive processor cannot be found, throw an errorthrow new Exception("Directive Processor not found");传递给这个函数的processorName是"T4VSHost",
现在
如果图像文件不存在于提供的路径中,则应用程序将使用默认图像(嵌入式资源)。一旦我有了图像,我需要调整它的大小以便在我的应用程序中进一步使用。如果试图在图像上放置一个条件(代码第2节),对象返回时会返回对象上的所有类型的异常,最明显的是出于我的目的:
((System.Drawing.Image)(ReportLogoToUse)).Height' threw an exception of type 'System.ArgumentException' int {System.Argument