Search code examples
servicestackappdynamics

Could not load type when using servicestack and AppDynamics monitor


When having the AppDynamics performance monitor installed, the servicestack API fails to load with the following exception:

Could not load type 'd__38' from assembly '###, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

StackTrace: at ###.BaseService1.<Any>d__38.MoveNext() in ###\Services\BaseService.cs:line 190 at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.Start[TStateMachine](TStateMachine& stateMachine) at ###.BaseService1.Any(T request) at ServiceStack.Host.ServiceRunner1.Execute(IRequest request, Object instance, TRequest requestDto)

Any help is greatly appreciated.

Thank you


Solution

  • For whom it might be of interest I have found a workaround and more details about this issue. This occurs only in the following scenario:

    1. AppDynamics agent is installed and running
    2. ServiceStack API is compiled using the MSBuild from c:\Windows\Microsoft.NET\Framework64\v4.0.30319\MsBuild.exe

    If you use the MsBuild 14 that is installed along Microsoft Visual Studio 2015 RC then this issue does not occur anymore. From my first findings there is an issue in ServiceStack's way of caching the endpoints and wrapping the execute method using Linq but I don't understand why this happens only when AppDynamics agent is installed.

    @mythz if you want to dig deeper into this issue I'm available to help but with the above solution everything is ok.

    Hope this helps