Man*_*eld 2 c# sql-server ssis bids visual-studio-2013
我创建了一个自定义PipelineComponent来将数据转换为Proper Case,如下所示:
[DtsPipelineComponent(DisplayName = "ProperCase")]
public class ProperCaseTransform : PipelineComponent
{
//irrelevant code here
}
Run Code Online (Sandbox Code Playgroud)
但是,当我将此组件添加到我的数据流,并单击"编辑"时,我遇到以下错误:
'null'的值对'stream'无效.(Microsoft Visual Studio)
课程地点:
在Microsoft.SqlServer.IntegrationServices.Designer.Common.ImageSourceHelper.GetIconFromResource的System.Drawing.Icon..ctor(Stream stream,Int32 height)的System.Drawing.Icon..ctor(Stream stream,Int32 width,Int32 height)处.程序集程序,String resourceName,Boolean isLarge)at Microsoft.DataTransformationServices.Design.DesignUtils.ExtractManagedBitmap(String fileName,String resName,Boolean large)at Microsoft.DataTransformationServices.Design.DesignUtils.ExtractBitmap(String fileName,String iconResource,Boolean isNative,Boolean在Microsoft.DataTransformationServices.Design.FunctionLevelUI.EditImpl(IWin32Window parentControl)的Microsoft.DataTransformationServices.Design.FunctionLevelMappingUI..ctor(FunctionLevelComponentUI componentUI,IUserPromptService promptService)上的Microsoft.DataTransformationServices.Design.PipelineUtils.GetComponentIcon(IDTSComponentMetaData100 componentMetadata,IServiceProvider serviceProvider) )在Microsoft.DataTransformationServ ices.Design.DtsComponentUI.Edit(IWin32Window parentWindow,变量变量,连接连接)
我已经看到Visual Studio 2012发生了类似的问题(显然CU4 for SP1修复了这个),但从未用于VS 2013.我该如何解决这个问题?我的组件在编辑时无法使用.
我被这个问题给出了提示:错误:'null'的值对'stream'无效.虽然这显然是IDE中的一个错误,但可以通过向我的自定义组件添加图标来修复:
[DtsPipelineComponent(DisplayName = "ProperCase", IconResource="MyNamespace.app.ico")]
public class ProperCaseTransform : PipelineComponent
{
//irrelevant code here
}
Run Code Online (Sandbox Code Playgroud)
然后我在dll(名为app.ico)中包含一个随机图标文件,将构建操作设置为"Embedded Resource",然后重新编译; 这解决了视觉工作室的问题.
注意:该IconResource值的格式为:
[ProjectNamespace] + "." + "Folder path separated by dots" + "." + "iconName.ico"
Run Code Online (Sandbox Code Playgroud)
项目命名空间在项目属性中定义.
示例:MyIcon.ico具有命名空间的项目中的文件夹图标中MyProject的图标将具有图标资源值"MyProject.Icons.MyIcon.ico"