With further debugging I found the my stored procedure is bailing before the userId lookup when I try to get the applicationId from the applicationName. Below is the code used to get the applicationName. If returns the virtual path of '/<application name>'. Note the inclusion of the forward slash. This does not equal <applicationName> which is what's in the database. This code also came from the toolkit in the SecUtil.cs I can augment my sql in the stored procedure but this seems like a bandaid when the aspnet database doesn't do this. Any suggestions?
internal static string GetDefaultAppName()
{
try
{
string appName = HostingEnvironment.ApplicationVirtualPath;
if (String.IsNullOrEmpty(appName))
{
appName = System.Diagnostics.Process.GetCurrentProcess().
MainModule.ModuleName;
int indexOfDot = appName.IndexOf('.');
if (indexOfDot != -1)
{
appName = appName.Remove(indexOfDot);
}
}
if (String.IsNullOrEmpty(appName))
{
return "/";
}
else
{
return appName;
}
}
catch
{
return "/";
}
}