I created a custom PipelineComponent
to convert data to Proper Case, like so:
[DtsPipelineComponent(DisplayName = "ProperCase")]
public class ProperCaseTransform : PipelineComponent
{
//irrelevant code here
}
However, when I add this component to my data flow, and click "edit", I am met with with following error:
Value of 'null' is not valid for 'stream'. (Microsoft Visual Studio)
Program Location:
at System.Drawing.Icon..ctor(Stream stream, Int32 width, Int32 height) at System.Drawing.Icon..ctor(Stream stream, Size size) at Microsoft.SqlServer.IntegrationServices.Designer.Common.ImageSourceHelper.GetIconFromResource(Assembly assembly, 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 large) at Microsoft.DataTransformationServices.Design.PipelineUtils.GetComponentIcon(IDTSComponentMetaData100 componentMetadata, IServiceProvider serviceProvider) at Microsoft.DataTransformationServices.Design.FunctionLevelMappingUI..ctor(FunctionLevelComponentUI componentUI, IUserPromptService promptService) at Microsoft.DataTransformationServices.Design.FunctionLevelComponentUI.EditImpl(IWin32Window parentControl) at Microsoft.DataTransformationServices.Design.DtsComponentUI.Edit(IWin32Window parentWindow, Variables variables, Connections connections)
I have seen similar problems happening with Visual Studio 2012 (apparently CU4 for SP1 fixes this), but never for VS 2013. How can I fix this issue? My component is unusable with editing.
I was tipped off by this question: error : Value of 'null' is not valid for 'stream'. Although this is clearly a bug in the IDE, it was possible to fix by adding an icon to my custom component:
[DtsPipelineComponent(DisplayName = "ProperCase", IconResource="MyNamespace.app.ico")]
public class ProperCaseTransform : PipelineComponent
{
//irrelevant code here
}
I then included a random icon file in the dll (named app.ico), set the build action to "Embedded Resource", and recompiled; which fixed the issue in visual studio.
NOTE: the IconResource
value has the format:
[ProjectNamespace] + "." + "Folder path separated by dots" + "." + "iconName.ico"
The project namespace is defined in the project properties.
Example: the icon MyIcon.ico
in the folder icons in a project with namespace MyProject
would have the icon resource value "MyProject.Icons.MyIcon.ico"
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments