Base solution for your next web application
Open Closed

Dynamic Proxies in .NET Core Template 1.1 not working #3332


User avatar
0
bsolutions created

Hi everyone,

I have a problem with the dynamic proxies. I included the dynamic proxies in my layout page:

<script src="~/AbpServiceProxies/GetAll?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>

But if I start my application and call <a class="postlink" href="http://localhost/AbpServiceProxies/GetAll?v=636322742374719274">http://localhost/AbpServiceProxies/GetA ... 2374719274</a> I get the following error:

An unhandled exception occurred while processing the request.

ArgumentNullException: Value cannot be null. Parameter name: key

The exception occurs in the ApiProxyScriptManager in the following method:

public string GetScript(ApiProxyGenerationOptions options)
{
    if (options.UseCache)
    {
        // On this line the error occurs. It looks like the CreateCacheKey(options) returns null
        return _cache.GetOrAdd(CreateCacheKey(options), (key) => CreateScript(options));
    }

     return _cache[CreateCacheKey(options)] = CreateScript(options);
}

Please help me to solve this problem. Thanks!


1 Answer(s)
  • User Avatar
    0
    bsolutions created

    The solution: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1413">https://github.com/aspnetboilerplate/as ... ssues/1413</a>

    Add script like that:

    <script src="~/AbpServiceProxies/GetAll?type=jquery&v=@(Clock.Now.Ticks)" type="text/javascript"></script>