Please add exception logging to all methods called by VS to visual studio error list. And log other fails, where we return fail status.
This should help a lot with errors like that: http://razorgenerator.codeplex.com/workitem/72
Default MessageBoxes from visual studio isn't helpfull at all (microsoft style of error reporting).
I use following code in my custom file generator for error reporting, so you can use it as sample:
private ErrorListProvider ErrorListPorvider
{
get
{
if (_errorListProvider == null)
{
_errorListProvider = new ErrorListProvider(this);
_errorListProvider.ProviderName = "Custom File Generator";
_errorListProvider.ProviderGuid = new Guid("1456E0E9-DE17-45AD-B075-A8CF6880927C");
_errorListProvider.Show();
return _errorListProvider;
}
return _errorListProvider;
}
}
protected void Log(string message, params object[] parameters)
{
Contract.Requires(message != null);
Contract.Requires(parameters != null);
var messageString = string.Format("Custom File Generator ({0}): {1}", this.GetType(), string.Format(message, parameters));
var errorTask = new ErrorTask();
errorTask.CanDelete = true;
errorTask.Category = TaskCategory.BuildCompile;
errorTask.Column = 1;
errorTask.Document = InputFilePath;
errorTask.ErrorCategory = TaskErrorCategory.Error;
errorTask.Line = 1;
errorTask.Priority = TaskPriority.Normal;
errorTask.Text = messageString;
if (ErrorListPorvider.Tasks != null)
{
ErrorListPorvider.Tasks.Add(errorTask);
}
Trace.WriteLine(messageString);
}
This should help a lot with errors like that: http://razorgenerator.codeplex.com/workitem/72
Default MessageBoxes from visual studio isn't helpfull at all (microsoft style of error reporting).
I use following code in my custom file generator for error reporting, so you can use it as sample:
private ErrorListProvider ErrorListPorvider
{
get
{
if (_errorListProvider == null)
{
_errorListProvider = new ErrorListProvider(this);
_errorListProvider.ProviderName = "Custom File Generator";
_errorListProvider.ProviderGuid = new Guid("1456E0E9-DE17-45AD-B075-A8CF6880927C");
_errorListProvider.Show();
return _errorListProvider;
}
return _errorListProvider;
}
}
protected void Log(string message, params object[] parameters)
{
Contract.Requires(message != null);
Contract.Requires(parameters != null);
var messageString = string.Format("Custom File Generator ({0}): {1}", this.GetType(), string.Format(message, parameters));
var errorTask = new ErrorTask();
errorTask.CanDelete = true;
errorTask.Category = TaskCategory.BuildCompile;
errorTask.Column = 1;
errorTask.Document = InputFilePath;
errorTask.ErrorCategory = TaskErrorCategory.Error;
errorTask.Line = 1;
errorTask.Priority = TaskPriority.Normal;
errorTask.Text = messageString;
if (ErrorListPorvider.Tasks != null)
{
ErrorListPorvider.Tasks.Add(errorTask);
}
Trace.WriteLine(messageString);
}