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.
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.