我创建了一个自定义PipelineComponent
来将数据转换为正确的案例,如下所示:
[DtsPipelineComponent(DisplayName = "ProperCase")]
public class ProperCaseTransform : PipelineComponent
{
//irrelevant code here
}
然而,当我将这个组件添加到我的数据流中,并单击"编辑"时,我会遇到以下错误:
"null"的值对于"stream"无效。(Microsoft Visual Studio)
项目地点:
在System.Drawing.Icon.ctor(流,Int32宽,Int32高)在System.Drawing.Icon.ctor(流,大小)位于Microsoft.SqlServer.IntegrationServices.Designer.Common.ImageSourceHelper.GetIconFromResource(程序集程序集,字符串资源名称,布尔值为大型)位于Microsoft.DataTransformationServices.DesignUtils.ExtractManagedBitmap(字符串文件名,字符串resName,大型布尔值)位于Microsoft.DataTransformationServices.Design.Utils.ExtractBitmap(字符串文件名,字符串图标资源,布尔值为本机,布尔值较大)位于Microsoft.DataTransformationServices.Design.PipelineUtils.GetComponentIcon(IDTSComponentMetaData100 componentMetadata,IServiceProvider serviceProvider)位于Microsoft.DataTransformationServices.Design.FunctionLevelMappingUI.ctor(FunctionLevelComponentUI组件UI,IUserPromptService提示服务)位于Microsoft.DataTransformationServices.Design.FunctionLevelComponentUI.EditImpl(IWin32WindowsparentControl)在Microsoft.DataTransformationServices.Design.DtsComponentUI.Edit(IWin32Window parentWindow,Variables Variables,Connections Connections)
我在Visual Studio 2012中看到过类似的问题(显然CU4 for SP1修复了这个问题),但在VS 2013中从未出现过。如何解决此问题?我的组件无法进行编辑。
我得到了这个问题的提示:错误:值为';null';对于';流';。虽然这显然是IDE中的一个错误,但可以通过在我的自定义组件中添加一个图标来修复:
[DtsPipelineComponent(DisplayName = "ProperCase", IconResource="MyNamespace.app.ico")]
public class ProperCaseTransform : PipelineComponent
{
//irrelevant code here
}
然后,我在dll中包含了一个随机图标文件(名为app.ico),将构建操作设置为"嵌入式资源",并重新编译;解决了visualstudio中的问题。
注意:IconResource
值的格式为:
[ProjectNamespace] + "." + "Folder path separated by dots" + "." + "iconName.ico"
项目命名空间是在项目属性中定义的。
示例:名称空间为MyProject
的项目中文件夹图标中的图标MyIcon.ico
将具有图标资源值"MyProject.Icons.MyIcon.ico"