The first call to a ria service is slow if they are many assemblies without PublicKeyToken (5s on my project).
The problem is the try/catch in OpenRiaServices.DomainServices.TypeUtility.IsSystemAssembly.
Solution : test if the key is null
```
try
{
if (assemblyFullName.Substring(idx + 15, 4) == "null")
return false;
string publicKeyToken = assemblyFullName.Substring(idx + 15, 16);
return systemAssemblyPublicKeyTokens.Any(p => p.Equals(publicKeyToken, StringComparison.OrdinalIgnoreCase));
}
catch (ArgumentOutOfRangeException)
{
return false;
}
```
With this modification, the first call take 0.8s.
Comments: With the lastest sources, this isn't resolved. The assemblyFullName contains "PublicKeyToken=" but the key is "null" and "assemblyFullName.Substring(idx + 15, 16)" causes a exception. ex: assemblyFullName = "Futura.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
The problem is the try/catch in OpenRiaServices.DomainServices.TypeUtility.IsSystemAssembly.
Solution : test if the key is null
```
try
{
if (assemblyFullName.Substring(idx + 15, 4) == "null")
return false;
string publicKeyToken = assemblyFullName.Substring(idx + 15, 16);
return systemAssemblyPublicKeyTokens.Any(p => p.Equals(publicKeyToken, StringComparison.OrdinalIgnoreCase));
}
catch (ArgumentOutOfRangeException)
{
return false;
}
```
With this modification, the first call take 0.8s.
Comments: With the lastest sources, this isn't resolved. The assemblyFullName contains "PublicKeyToken=" but the key is "null" and "assemblyFullName.Substring(idx + 15, 16)" causes a exception. ex: assemblyFullName = "Futura.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"