# Problem making target deleting addin

**URL:** <https://tech-community.robotics.abb.com/t/problem-making-target-deleting-addin/9254>\
**Category:** Developer Tools\
**Created:** [January 2, 2020, 9:40am UTC](https://tech-community.robotics.abb.com/t/problem-making-target-deleting-addin/9254 "2020-01-02T09:40:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tonibeibe](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@Tonibeibe](https://tech-community.robotics.abb.com/u/Tonibeibe)\
**Post date:** [January 2, 2020, 9:40am UTC](https://tech-community.robotics.abb.com/t/problem-making-target-deleting-addin/9254/1 "2020-01-02T09:40:54Z")

</div>

Hello,

I’m having issues in making addin that deletes unused targets. I’ve done addin using this example [http://developercenter.robotstudio.com/blobproxy/devcenter/RobotStudio/html/2aca5da4-6f94-43a0-9817-5f413d16f510.htm](http://developercenter.robotstudio.com/blobproxy/devcenter/RobotStudio/html/2aca5da4-6f94-43a0-9817-5f413d16f510.htm) and my program is basically a copypaste of that.

When I load addin in Robotstudio I get following error:

# RobotStudio .NET exception: Length cannot be less than zero. Parameter name: length

Base exception: ArgumentOutOfRangeException  
Length cannot be less than zero.  
Parameter name: length  
at System.String.Substring(Int32 startIndex, Int32 length)  
at RobotStudio.ExtensionManagement.Addin.TryLoad()  
ParamName:length

I have no idea what causes this. I’m using Robotstudio 2019.3 and RobotWare 6.10

If that error is in addin code, the line 32 would be “if (inst.Length == 0)”.  
I’ve tried to change that value to \< 1 but no difference.  
Addin.dll and Addin.rsaddin are located in ABB/RobotStudio 2019/Bin/Addins

Our robot is used in educational purposes, so the targets pile up pretty quickly and I’d like to use this to clean things up.

---

<div class="post-metadata">

**Author:** ![Tonibeibe](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@Tonibeibe](https://tech-community.robotics.abb.com/u/Tonibeibe)\
**Post date:** [January 5, 2020, 8:19am UTC](https://tech-community.robotics.abb.com/t/problem-making-target-deleting-addin/9254/2 "2020-01-05T08:19:05Z")

</div>

I get the same error when i run this code:

using System;  
using System.Collections.Generic;  
using System.Text;

using ABB.Robotics.Math;  
using ABB.Robotics.RobotStudio;  
using ABB.Robotics.RobotStudio.Environment;  
using ABB.Robotics.RobotStudio.Stations;

namespace RobotStudioEmptyAddin1  
{  
public class Class1  
{  
// This is the entry point which will be called when the Add-in is loaded  
public static void AddinMain()  
{  
System.Diagnostics.Debug.WriteLine(“Hello world!”);  
}  
}  
}

Could it be, that I’m missing some package?
