doesn't work?

Jun 4, 2012 at 10:56 PM

copied example from here, followed instructions, does not work...

System.ArgumentException was unhandled  Message=shortName  Source=CommandLine  StackTrace:       at CommandLine.BaseOptionAttribute.set_ShortName(String value)       at CommandLine.OptionAttribute..ctor(String shortName, String longName)       at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)       at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType)       at System.Reflection.RuntimePropertyInfo.GetCustomAttributes(Type attributeType, Boolean inherit)       at System.Attribute.InternalGetCustomAttributes(PropertyInfo element, Type type, Boolean inherit)       at System.Attribute.GetCustomAttributes(MemberInfo element, Type type, Boolean inherit)       at System.Attribute.GetCustomAttribute(MemberInfo element, Type attributeType, Boolean inherit)       at CommandLine.ReflectionUtil.RetrievePropertyList[TAttribute](Object target)       at CommandLine.OptionInfo.CreateMap(Object target, CommandLineParserSettings settings)       at CommandLine.CommandLineParser.DoParseArguments(String[] args, Object options)       at CommandLine.CommandLineParser.ParseArguments(String[] args, Object options, TextWriter helpWriter)       at CommandLine.CommandLineParser.ParseArguments(String[] args, Object options)       at getasi.Program.Main(String[] args) in C:\Users\rlassiter\documents\visual studio 2010\Projects\getasi\getasi\Program.cs:line 19       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)       at System.Threading.ThreadHelper.ThreadStart()  InnerException: 

Coordinator
Jun 5, 2012 at 7:45 PM

Please post code that doesn't work and specify version used.

Regards. Giacomo

Jul 17, 2012 at 7:26 AM

I experienced the same behaviour, an unhandled System.ArgumentException("shortname").

I found out it was caused by the fact that my short name was more than 1 character, which appears to be not allowed.

Maybe you can change the exception description to reflect that cause?

Oct 12, 2012 at 4:03 PM
Edited Oct 12, 2012 at 4:09 PM

Actually I realize (JeanPaulSmit) the short name has to be of length 1, I guess the best solution is a more detailed exception.

Thanks,
Matt