【问题标题】:Editing custom SSIS PipelinComponent throws error "value of 'null' is not valid for 'stream'"编辑自定义 SSIS PipelinComponent 会引发错误“'null' 的值对 'stream' 无效”
【发布时间】:2014-09-26 19:10:23
【问题描述】:

我创建了一个自定义 PipelineComponent 来将数据转换为正确大小写,如下所示:

[DtsPipelineComponent(DisplayName = "ProperCase")]
public class ProperCaseTransform : PipelineComponent
{
    //irrelevant code here
}

但是,当我将此组件添加到我的数据流中并单击“编辑”时,我遇到了以下错误:

“null”的值对“stream”无效。 (微软视觉工作室)


节目地点:

在 System.Drawing.Icon..ctor(Stream 流,Int32 宽度,Int32 高度) 在 System.Drawing.Icon..ctor(流流,大小大小) 在 Microsoft.SqlServer.IntegrationServices.Designer.Common.ImageSourceHelper.GetIconFromResource(程序集,字符串资源名称,布尔 isLarge) 在 Microsoft.DataTransformationServices.Design.DesignUtils.ExtractManagedBitmap(字符串文件名,字符串 resName,布尔大) 在 Microsoft.DataTransformationServices.Design.DesignUtils.ExtractBitmap(字符串文件名,字符串 iconResource,布尔 isNative,布尔大) 在 Microsoft.DataTransformationServices.Design.PipelineUtils.GetComponentIcon(IDTSComponentMetaData100 组件元数据,IServiceProvider serviceProvider) 在 Microsoft.DataTransformationServices.Design.FunctionLevelMappingUI..ctor(FunctionLevelComponentUI componentUI,IUserPromptService promptService) 在 Microsoft.DataTransformationServices.Design.FunctionLevelComponentUI.EditImpl(IWin32Window parentControl) 在 Microsoft.DataTransformationServices.Design.DtsComponentUI.Edit(IWin32Window parentWindow, Variables variables, Connections 连接)

我已经看到 Visual Studio 2012 发生了类似的问题(显然 CU4 for SP1 解决了这个问题),但 VS 2013 从来没有。我该如何解决这个问题?我的组件无法编辑。

【问题讨论】:

标签: c# sql-server ssis visual-studio-2013 bids


【解决方案1】:

我被这个问题告知:error : Value of 'null' is not valid for 'stream'。虽然这显然是 IDE 中的一个错误,但可以通过向我的自定义组件添加一个图标来修复:

[DtsPipelineComponent(DisplayName = "ProperCase", IconResource="MyNamespace.app.ico")]
public class ProperCaseTransform : PipelineComponent
{
    //irrelevant code here
}

然后我在 dll 中包含了一个随机图标文件(名为 app.ico),将构建操作设置为“嵌入式资源”,然后重新编译;这解决了视觉工作室中的问题。

注意:IconResource 值的格式为:

[ProjectNamespace] + "." + "Folder path separated by dots" + "." + "iconName.ico"

项目命名空间在项目属性中定义。

示例:名称空间为MyProject 的项目中文件夹图标中的图标MyIcon.ico 将具有图标资源值"MyProject.Icons.MyIcon.ico"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-14
    • 1970-01-01
    • 2017-10-31
    • 1970-01-01
    相关资源
    最近更新 更多