The error typically indicates that some data may not necessarily be available to the web part in the design view (ie. you put the web part on a page template that displays data based on being used on a nested page). In this case you should put a check for the 'IsDesign' property and if true then display alternative content.
Also as a point to note here, in the control definition you posted, the path to codefile indicates that you have used spaces in the filename. In some cases this may lead to other errors due to the fact that the spaces would need to be encoded and hence I recommend you change these to an underscore ('_') - this would be especially true if you use a space in the filename of an ASPX page since a link to the page would need to be like http://some.webserver.com/path1/my%20long%20filename.aspx instead of "http://some.webserver.com/path1/my long filename.aspx".