2014-09-02

T4 text transformation error - The message filter indicated that the application is busy

Error    1    Running transformation: System.Runtime.InteropServices.COMException (0x8001010A): The message filter indicated that the application is busy. (Exception from HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER))
   at EnvDTE.CodeFunction.get_Access()
   at Microsoft. VisualStudio. TextTemplating. GeneratedTextTransformation. GetModuleFunctions(CodeClass a_module_class) in d:\ ... Service. Generator.tt:line 310
   at Microsoft. VisualStudio. TextTemplating. GeneratedTextTransformation. TransformText() in d:\ ... Service. Generator.tt:line 27. Line=310, Column=0

Concurrent projects compiling must be set in options (so this error only applied to VS2013 and newer). See: How to do a parallel build in Visual Studio 2013?

More than one project must contain *. tt text transform. And those projects must have enabled transform on build. See: Understanding T4: MSBuild Integration

The error message looks very cryptic. In the end I found out there is problem with concurrent projects building, when probably two or more projects try to run text transform simultaneously.

One very undesirable solution is to disable concurrent build.

Second is to manipulate project dependencies in such manner that problematic projects run one by one. See: How to: Create and Remove Project Dependencies

We may also use some locks in tt code.

The open question which I haven't investigated is how this behaves with msbuild.

Brak komentarzy:

Prześlij komentarz