Error accessing Key Vault while executing Azure Synapse Notebook via Synapse Pipelines - runtime-error

I'm trying to execute an Azure Synapse Notebook using Notebook Activity in Synapse Pipelines and it keeps coming up with errors while debuging the Pipelines, the Notebook is using TokenLibrary.getSecret() and it looks like accessing key vault is the problem.
The notebook runs fine when executed its when added as pipeline activity the error comes up.
The key vault access policies are set to give both me and the synapse app get and list on secrets.
Many thanks for any help in advance.
Mariusz
Error msg for ref:
Microsoft Azure
Synapse Analytics
Search
/
feature/fixError6002 branch
Develop
Filter resources by name
SQL scripts
1
Notebooks
40
Data flows
1
Activities
Search activities
Synapse
Move & transform
Azure Data Explorer
Azure Function
Batch Service
Databricks
Data Lake Analytics
General
HDInsight
Iteration & conditionals
Machine Learning
Pipeline run ID:
58ff181a-37e6-47b8-b3d8-fe94295b9ec7
View debug run consumption
Name
Type
Run start
Duration
Status
Integration runtime
Run ID
Invoke Notebook
Notebook
2021-09-29T10:44:24.3680765Z
00:02:04
Failed
DefaultIntegrationRuntime (UK South)
9a6773d8-69e7-46f6-bc99-25878637b7b7
Log Pipeline Start
Azure Function
2021-09-29T10:44:19.9601216Z
00:00:03
Succeeded
IR-AZ-Runtime (UK South)
8280f852-1915-49ab-a6a8-35bf22a716bb
Error
{
"errorCode": "6002",
"message": "Py4JJavaError: An error occurred while calling z:com.microsoft.azure.synapse.tokenlibrary.TokenLibrary.getSecret.\n: java.lang.Exception: Access token couldn't be obtained {\"result\":\"DependencyError\",\"errorId\":\"BadRequest\",\"errorMessage\":\"LSRServiceException is [{\\\"StatusCode\\\":400,\\\"ErrorResponse\\\":{\\\"code\\\":\\\"LSRResolveFailure\\\",\\\"message\\\":\\\"Cannot acquire MSI token for a Vault audience.\\\",\\\"target\\\":\\\"Vault\\\"},\\\"Message\\\":\\\"Cannot acquire MSI token for a Vault audience.\\\",\\\"Data\\\":{},\\\"InnerException\\\":null,\\\"StackTrace\\\":\\\" at Microsoft.Marlin.Common.ADF.Impl.LSRClient.CheckForFailures(HttpResponseMessage response, String responseContent) in C:\\\\\\\\source\\\\\\\\Common\\\\\\\\Microsoft.Marlin.Common.ADF\\\\\\\\Impl\\\\\\\\LSRClient.cs:line 272\\\\r\\\\n at Microsoft.Marlin.Common.ADF.Impl.LSRClient.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken, String traceId) in C:\\\\\\\\source\\\\\\\\Common\\\\\\\\Microsoft.Marlin.Common.ADF\\\\\\\\Impl\\\\\\\\LSRClient.cs:line 288\\\\r\\\\n at Microsoft.Marlin.Common.ADF.Impl.LSRClient.ResolveAudienceAsync(String audience, ResolveAudienceRequest request, String traceId, CancellationToken cancellationToken) in C:\\\\\\\\source\\\\\\\\Common\\\\\\\\Microsoft.Marlin.Common.ADF\\\\\\\\Impl\\\\\\\\LSRClient.cs:line 164\\\\r\\\\n at Microsoft.Marlin.TokenService.Token.LSRAudienceTokenProvider.GetToken(Boolean isLinkedService, String audience, String sessionToken, CancellationToken cancellationToken) in C:\\\\\\\\source\\\\\\\\TokenService\\\\\\\\Microsoft.Marlin.TokenService\\\\\\\\Token\\\\\\\\LSRAudienceTokenProvider.cs:line 140\\\\r\\\\n at Microsoft.Marlin.TokenService.Token.LSRAudienceTokenProvider.GetTokenForAudienceAsync(Boolean isLinkedService, String audience, String account, String sessionToken, SignaturePayload signaturePayload, CancellationToken cancellationToken) in C:\\\\\\\\source\\\\\\\\TokenService\\\\\\\\Microsoft.Marlin.TokenService\\\\\\\\Token\\\\\\\\LSRAudienceTokenProvider.cs:line 67\\\\r\\\\n at Microsoft.Marlin.TokenService.Controllers.TokenController.GetTokenAsync(TokenRequest request, CancellationToken cancellationToken) in C:\\\\\\\\source\\\\\\\\TokenService\\\\\\\\Microsoft.Marlin.TokenService\\\\\\\\Controllers\\\\\\\\TokenController.cs:line 67\\\\r\\\\n at lambda_method(Closure , Object )\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()\\\\r\\\\n at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)\\\\r\\\\n at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)\\\\r\\\\n at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)\\\\r\\\\n at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)\\\\r\\\\n at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)\\\\r\\\\n at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)\\\\r\\\\n at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)\\\\r\\\\n at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)\\\",\\\"HelpLink\\\":null,\\\"Source\\\":\\\"Microsoft.Marlin.Common.ADF\\\",\\\"HResult\\\":-2146233088}]. TraceId : 8158a0b1-4612-48de-aaa5-c443c564d25b. Error Component : LSR\"}\n\tat com.microsoft.azure.synapse.tokenlibrary.TokenLibrary$$anonfun$9.apply(TokenLibrary.scala:382)\n\tat com.microsoft.azure.synapse.tokenlibrary.TokenLibrary$$anonfun$9.apply(TokenLibrary.scala:374)\n\tat com.twitter.util.Future$$anonfun$flatMap$1.apply(Future.scala:1808)\n\tat com.twitter.util.Future$$anonfun$flatMap$1.apply(Future.scala:1807)\n\tat com.twitter.util.Promise$FutureTransformer.liftedTree1$1(Promise.scala:240)\n\tat com.twitter.util.Promise$FutureTransformer.k(Promise.scala:240)\n\tat com.twitter.util.Promise$Transformer.apply(Promise.scala:215)\n\tat com.twitter.util.Promise$WaitQueue.com$twitter$util$Promise$WaitQueue$$run(Promise.scala:91)\n\tat com.twitter.util.Promise$WaitQueue$$anon$4.run(Promise.scala:86)\n\tat com.twitter.concurrent.LocalScheduler$Activation.run(Scheduler.scala:198)\n\tat com.twitter.concurrent.LocalScheduler$Activation.submit(Scheduler.scala:157)\n\tat com.twitter.concurrent.LocalScheduler.submit(Scheduler.scala:274)\n\tat com.twitter.concurrent.Scheduler$.submit(Scheduler.scala:109)\n\tat com.twitter.util.Promise$WaitQueue.runInScheduler(Promise.scala:86)\n\tat com.twitter.util.Promise.updateIfEmpty(Promise.scala:778)\n\tat com.twitter.util.Promise.update(Promise.scala:750)\n\tat com.twitter.util.Promise.setValue(Promise.scala:726)\n\tat com.twitter.concurrent.AsyncQueue.offer(AsyncQueue.scala:123)\n\tat com.twitter.finagle.netty4.transport.ChannelTransport$$anon$2.channelRead(ChannelTransport.scala:168)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat com.twitter.finagle.netty4.http.handler.UnpoolHttpHandler$.channelRead(UnpoolHttpHandler.scala:32)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat com.twitter.finagle.netty4.http.handler.ClientExceptionMapper$.channelRead(ClientExceptionMapper.scala:35)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat com.twitter.finagle.netty4.http.handler.HeaderValidatorHandler$.channelRead(HeaderValidatorHandler.scala:51)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)\n\tat io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328)\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302)\n\tat io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1475)\n\tat io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1224)\n\tat io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1271)\n\tat io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:505)\n\tat io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:444)\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:283)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931)\n\tat io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:792)\n\tat io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:483)\n\tat io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:383)\n\tat io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044)\n\tat io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat com.twitter.finagle.util.BlockingTimeTrackingThreadFactory$$anon$1.run(BlockingTimeTrackingThreadFactory.scala:23)\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\tat java.lang.Thread.run(Thread.java:748)\n\nTraceback (most recent call last):\n\n File \"<stdin>\", line 9, in get_cloudinary_data\n\n File \"/opt/spark/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py\", line 1257, in __call__\n answer, self.gateway_client, self.target_id, self.name)\n\n File \"/opt/spark/python/lib/pyspark.zip/pyspark/sql/utils.py\", line 69, in deco\n return f(*a, **kw)\n\n File \"/opt/spark/python/lib/py4j-0.10.7-src.zip/py4j/protocol.py\", line 328, in get_return_value\n format(target_id, \".\", name), value)\n\npy4j.protocol.Py4JJavaError: An error occurred while calling z:com.microsoft.azure.synapse.tokenlibrary.TokenLibrary.getSecret.\n: java.lang.Exception: Access token couldn't be obtained {\"result\":\"DependencyError\",\"errorId\":\"BadRequest\",\"errorMessage\":\"LSRServiceException is [{\\\"StatusCode\\\":400,\\\"ErrorResponse\\\":{\\\"code\\\":\\\"LSRResolveFailure\\\",\\\"message\\\":\\\"Cannot acquire MSI token for a Vault audience.\\\",\\\"target\\\":\\\"Vault\\\"},\\\"Message\\\":\\\"Cannot acquire MSI token for a Vault audience.\\\",\\\"Data\\\":{},\\\"InnerException\\\":null,\\\"StackTrace\\\":\\\" at Microsoft.Marlin.Common.ADF.Impl.LSRClient.CheckForFailures(HttpResponseMessage response, String responseContent) in C:\\\\\\\\source\\\\\\\\Common\\\\\\\\Microsoft.Marlin.Common.ADF\\\\\\\\Impl\\\\\\\\LSRClient.cs:line 272\\\\r\\\\n at Microsoft.Marlin.Common.ADF.Impl.LSRClient.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken, String traceId) in C:\\\\\\\\source\\\\\\\\Common\\\\\\\\Microsoft.Marlin.Common.ADF\\\\\\\\Impl\\\\\\\\LSRClient.cs:line 288\\\\r\\\\n at Microsoft.Marlin.Common.ADF.Impl.LSRClient.ResolveAudienceAsync(String audience, ResolveAudienceRequest request, String traceId, CancellationToken cancellationToken) in C:\\\\\\\\source\\\\\\\\Common\\\\\\\\Microsoft.Marlin.Common.ADF\\\\\\\\Impl\\\\\\\\LSRClient.cs:line 164\\\\r\\\\n at Microsoft.Marlin.TokenService.Token.LSRAudienceTokenProvider.GetToken(Boolean isLinkedService, String audience, String sessionToken, CancellationToken cancellationToken) in C:\\\\\\\\source\\\\\\\\TokenService\\\\\\\\Microsoft.Marlin.TokenService\\\\\\\\Token\\\\\\\\LSRAudienceTokenProvider.cs:line 140\\\\r\\\\n at Microsoft.Marlin.TokenService.Token.LSRAudienceTokenProvider.GetTokenForAudienceAsync(Boolean isLinkedService, String audience, String account, String sessionToken, SignaturePayload signaturePayload, CancellationToken cancellationToken) in C:\\\\\\\\source\\\\\\\\TokenService\\\\\\\\Microsoft.Marlin.TokenService\\\\\\\\Token\\\\\\\\LSRAudienceTokenProvider.cs:line 67\\\\r\\\\n at Microsoft.Marlin.TokenService.Controllers.TokenController.GetTokenAsync(TokenRequest request, CancellationToken cancellationToken) in C:\\\\\\\\source\\\\\\\\TokenService\\\\\\\\Microsoft.Marlin.TokenService\\\\\\\\Controllers\\\\\\\\TokenController.cs:line 67\\\\r\\\\n at lambda_method(Closure , Object )\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()\\\\r\\\\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()\\\\r\\\\n at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)\\\\r\\\\n at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)\\\\r\\\\n at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)\\\\r\\\\n at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)\\\\r\\\\n at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)\\\\r\\\\n at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)\\\\r\\\\n at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)\\\\r\\\\n at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)\\\",\\\"HelpLink\\\":null,\\\"Source\\\":\\\"Microsoft.Marlin.Common.ADF\\\",\\\"HResult\\\":-2146233088}]. TraceId : 8158a0b1-4612-48de-aaa5-c443c564d25b. Error Component : LSR\"}\n\tat com.microsoft.azure.synapse.tokenlibrary.TokenLibrary$$anonfun$9.apply(TokenLibrary.scala:382)\n\tat com.microsoft.azure.synapse.tokenlibrary.TokenLibrary$$anonfun$9.apply(TokenLibrary.scala:374)\n\tat com.twitter.util.Future$$anonfun$flatMap$1.apply(Future.scala:1808)\n\tat com.twitter.util.Future$$anonfun$flatMap$1.apply(Future.scala:1807)\n\tat com.twitter.util.Promise$FutureTransformer.liftedTree1$1(Promise.scala:240)\n\tat com.twitter.util.Promise$FutureTransformer.k(Promise.scala:240)\n\tat com.twitter.util.Promise$Transformer.apply(Promise.scala:215)\n\tat com.twitter.util.Promise$WaitQueue.com$twitter$util$Promise$WaitQueue$$run(Promise.scala:91)\n\tat com.twitter.util.Promise$WaitQueue$$anon$4.run(Promise.scala:86)\n\tat com.twitter.concurrent.LocalScheduler$Activation.run(Scheduler.scala:198)\n\tat com.twitter.concurrent.LocalScheduler$Activation.submit(Scheduler.scala:157)\n\tat com.twitter.concurrent.LocalScheduler.submit(Scheduler.scala:274)\n\tat com.twitter.concurrent.Scheduler$.submit(Scheduler.scala:109)\n\tat com.twitter.util.Promise$WaitQueue.runInScheduler(Promise.scala:86)\n\tat com.twitter.util.Promise.updateIfEmpty(Promise.scala:778)\n\tat com.twitter.util.Promise.update(Promise.scala:750)\n\tat com.twitter.util.Promise.setValue(Promise.scala:726)\n\tat com.twitter.concurrent.AsyncQueue.offer(AsyncQueue.scala:123)\n\tat com.twitter.finagle.netty4.transport.ChannelTransport$$anon$2.channelRead(ChannelTransport.scala:168)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat com.twitter.finagle.netty4.http.handler.UnpoolHttpHandler$.channelRead(UnpoolHttpHandler.scala:32)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat com.twitter.finagle.netty4.http.handler.ClientExceptionMapper$.channelRead(ClientExceptionMapper.scala:35)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat com.twitter.finagle.netty4.http.handler.HeaderValidatorHandler$.channelRead(HeaderValidatorHandler.scala:51)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)\n\tat io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328)\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302)\n\tat io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1475)\n\tat io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1224)\n\tat io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1271)\n\tat io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:505)\n\tat io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:444)\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:283)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)\n\tat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931)\n\tat io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:792)\n\tat io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:483)\n\tat io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:383)\n\tat io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044)\n\tat io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat com.twitter.finagle.util.BlockingTimeTrackingThreadFactory$$anon$1.run(BlockingTimeTrackingThreadFactory.scala:23)\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\tat java.lang.Thread.run(Thread.java:748)\n\n",
"failureType": "UserError",
"target": "Invoke Notebook",
"details": []
}

Please make sure to enable MSI(managed service identity) under identity > system /user assigned(ON) and make sure to add access policies properly to the KeyVault secrets, and also add a LinkedService to the Azure Synapse pointing to the KeyVault.
(Then restart again)
If your url is something like below
url = TokenLibrary.getSecret("mykeyvault", "ConnectionString")
Try to also linked service as a third parameter like below
url = TokenLibrary.getSecret("mykeyvault", "ConnectionString", "AzureKeyVaultLinkedServiceName")
References:
secure-credentials-with-tokenlibrary | Microsoft docs
access-secret-from-vault-using-synapse | microsoft Q&A
securely-access-Article-dzone

Running it in parallel, maybe with a for loop that is not sequentialmight be problematic. I seem to have a similar issue, when running the same notebook multiple times in parallel (each sending requests to the keyvault at the same time).

Related

error XALNK7000: Mono.Linker.MarkException: Error processing method: 'System.Void Xamarin.Forms.Accessor/RuntimeRootNode

this error appearing me when build the app on release mode and linking on SDKonly
I think this error happens because I add firebase notification plugins and added the plugin.fingerprint or because updated all plugins on app
I tried to set linking on none but appearing me another error,
the error is after build and archives the app and when install the app on device appearing my error (the application is not installed
Severity Code Description Project File Line Suppression State
Error Mono.Linker.MarkException: Error processing method: 'System.Void Xamarin.Forms.Accessor/RuntimeRootNode::.ctor(Xamarin.Forms.Xaml.XmlType,System.Xml.IXmlNamespaceResolver)' in assembly: 'Xamarin.Forms.Loader.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Xamarin.Forms.Xaml.RootNode::.ctor(Xamarin.Forms.Xaml.XmlType,System.Xml.IXmlNamespaceResolver)
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.RunTask()
at Xamarin.Android.Tasks.AndroidTask.Execute() Almond.Droid

The "LinkAssemblies" task failed unexpectedly in Plugin.FirebasePushNotification

I am trying to release the application on Android using Linker to reduce the apk size.
When I use None I don´t have problem.
When I use SDK Assemblies Only I get the next error:
Severity Code Description Project File Line Suppression State
Error The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Void Plugin.FirebasePushNotification.FirebasePushNotificationManager::Subscribe(System.String)' in assembly: 'Plugin.FirebasePushNotification.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Firebase.Messaging.FirebaseMessaging::SubscribeToTopic(System.String)
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

Asp Net Core on Ubuntu - access is denied

After installing library MailKit and calling new SmtpClient().ConnectAsync(_settings.Server, _settings.Port, _settings.SSL); I get this error:
Access to the path '/var/www/.dotnet/corefx/cryptography/crls' is denied.
by the way, my project is located on /media/ProjectName.
i tried perform this: sudo chmod -R 755 /var but i got permission error.
here is stacktrace:
at System.IO.UnixFileSystem.CreateDirectory(String fullPath)↵ at System.IO.Directory.CreateDirectory(String path)↵ at Internal.Cryptography.Pal.CrlCache.GetCachedCrlPath(X509Certificate2 cert, Boolean mkDir)↵ at Internal.Cryptography.Pal.CrlCache.DownloadAndAddCrl(X509Certificate2 cert, SafeX509StoreHandle store, TimeSpan& remainingDownloadTime)↵ at Internal.Cryptography.Pal.CrlCache.AddCrlForCertificate(X509Certificate2 cert, SafeX509StoreHandle store, X509RevocationMode revocationMode, DateTime verificationTime, TimeSpan& remainingDownloadTime)↵ at Internal.Cryptography.Pal.OpenSslX509ChainProcessor.BuildChain(X509Certificate2 leaf, HashSet1 candidates, HashSet1 downloaded, HashSet1 systemTrusted, OidCollection applicationPolicy, OidCollection certificatePolicy, X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan& remainingDownloadTime)↵ at Internal.Cryptography.Pal.ChainPal.BuildChain(Boolean useMachineContext, ICertificatePal cert, X509Certificate2Collection extraStore, OidCollection applicationPolicy, OidCollection certificatePolicy, X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan timeout)↵ at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate)↵ at System.Net.Security.CertificateValidation.BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, Boolean checkCertName, String hostName)↵ at System.Net.Security.SecureChannel.VerifyRemoteCertificate(RemoteCertValidationCallback remoteCertValidationCallback)↵ at System.Net.Security.SslState.CompleteHandshake()↵ at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)↵ at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)↵ at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)↵ at System.Net.Security.SslState.ReadFrameCallback(AsyncProtocolRequest asyncRequest)↵--- End of stack trace from previous location where exception was thrown ---↵ at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()↵ at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)↵ at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)↵ at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)↵ at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task`1 promise, Boolean requiresSynchronization)↵--- End of stack trace from previous location where exception was thrown ---↵ at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)↵ at MailKit.Net.Smtp.SmtpClient.Connect(String host, Int32 port, SecureSocketOptions options, CancellationToken cancellationToken)↵ at MailKit.MailService.<>c__DisplayClass41_0.b__0()↵ at System.Threading.Tasks.Task.Execute()↵--- End of stack trace from previous location where exception was thrown ---↵ at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)↵ at MyProject.Services.MessageService.d__4.MoveNext()↵--- End of stack trace from previous location where exception was thrown ---↵ at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)↵ at MyProject.Services.MessageService.d__5.MoveNext()
As Lex Li posted create directory /var/www/.dotnet/corefx/cryptography/crls and give rights to www-data group (if this is the group that runs your service)
sudo chgrp www-data /var/www/.dotnet/corefx/cryptography/crls
I was referring this guide. In the kestrel-hellomvc.service file replaced User=www-data with User=my-root-username and it worked.
Hope it helps someone.

ApplicationInsights Telemetry exception in system automation

In a project we call Powershell scripts in C#.
using (var runspace = RunspaceFactory.CreateRunspace())
{
runspace.Open();
var pipeline = runspace.CreatePipeline();
..
pipeline.Invoke();
..
This works without any issues until ApplicationInsights Telemetry package is installed. Version 1.2.x had this issue so I upgrade to 2.0.0, but still the same exception.
Stacktrace below:
System.Management.Automation.CmdletInvocationException
The type initializer for
'Microsoft.WindowsAzure.Commands.Common.MetricHelper' threw an
exception. System.Management.Automation.CmdletInvocationException: The
type initializer for
'Microsoft.WindowsAzure.Commands.Common.MetricHelper' threw an
exception. ---> System.TypeInitializationException: The type
initializer for 'Microsoft.WindowsAzure.Commands.Common.MetricHelper'
threw an exception. ---> System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. --->
System.InvalidOperationException: Type
'Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule,
Microsoft.AI.DependencyCollector, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' does not implement the required
interface
Microsoft.ApplicationInsights.Extensibility.ITelemetryModule. at
Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.CreateInstance(Type
interfaceType, String typeName) at
Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.LoadInstance(XElement
definition, Type expectedType, Object instance) at
Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.LoadInstances[T](XElement
definition, ICollection`1 instances) --- End of inner exception
stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object
target, Object[] arguments, Signature sig, Boolean constructor) at
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,
Object[] parameters, Object[] arguments) at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at
Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.LoadInstance(XElement
definition, Type expectedType, Object instance) at
Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.LoadProperties(XElement
instanceDefinition, Object instance) at
Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.LoadInstance(XElement
definition, Type expectedType, Object instance) at
Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryConfigurationFactory.Initialize(TelemetryConfiguration
configuration) at
Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.get_Active()
at Microsoft.ApplicationInsights.TelemetryClient..ctor() at
Microsoft.WindowsAzure.Commands.Common.MetricHelper..cctor() ---
End of inner exception stack trace --- at
Microsoft.WindowsAzure.Commands.Common.MetricHelper.GenerateSha256HashString(String
originInput) at
Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.InitializeQosEvent()
at
Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing()
at
Microsoft.WindowsAzure.Commands.Utilities.Profile.SubscriptionCmdletBase.BeginProcessing()
at System.Management.Automation.Cmdlet.DoBeginProcessing() at
System.Management.Automation.CommandProcessorBase.DoBegin() --- End
of inner exception stack trace --- at
System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable
input)
For now I deinstalled the NuGet package for ApplicationInsights, because I don't know a solution. Perhaps it's a bug in ApplicationInsights?

Ninject ASP.NET extension throwing TypeLoadException

I'm trying to use Ninject 3 in an ASP.NET webforms application. We've been using it without the Ninject.Web extension for a while by creating a new injection kernel everywhere we needed one. It didn't occur to me until now that that's not the right way to do things. I wrote a little test application that is successfully using Ninject.Web, but when I tried to do the same thing in our real application, I'm receiving a TypeLoadException as soon as the page loads. It doesn't even make it into my code where I can set a breakpoint. Here's the exception and stack trace:
Could not load type
'System.Runtime.CompilerServices.ExtensionAttribute' from assembly
'mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.TypeLoadException: Could not load type
'System.Runtime.CompilerServices.ExtensionAttribute' from assembly
'mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[TypeLoadException: Could not load type
'System.Runtime.CompilerServices.ExtensionAttribute' from assembly
'mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'.]
System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken,
IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs,
Int32 methodInstCount, ObjectHandleOnStack type) +0
System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module,
Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext,
RuntimeTypeHandle[] methodInstantiationContext) +525
System.ModuleHandle.ResolveTypeHandle(Int32 typeToken,
RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[]
methodInstantiationContext) +19
System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken,
Type[] genericTypeArguments, Type[] genericMethodArguments) +315
System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord
caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly,
RuntimeModule decoratedModule, MetadataToken decoratedToken,
RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[]
attributes, IList derivedAttributes, RuntimeType& attributeType,
IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean&
isVarArg) +208
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule
decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount,
RuntimeType attributeFilterType, Boolean mustBeInheritable, IList
derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +1171
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly
assembly, RuntimeType caType) +146
WebActivator.AssemblyExtensions.GetActivationAttributes(Assembly
assembly) +114
WebActivator.ActivationManager.RunActivationMethods() +286
WebActivator.ActivationManager.RunPreStartMethods() +38
WebActivator.ActivationManager.Run() +56
[InvalidOperationException: The pre-application start initialization
method Run on type WebActivator.ActivationManager threw an exception
with the following error message: Could not load type
'System.Runtime.CompilerServices.ExtensionAttribute' from assembly
'mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1
methods) +11567502
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +465
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters,
PolicyLevel policyLevel, Exception appDomainCreationException) +1167
[HttpException (0x80004005): The pre-application start initialization
method Run on type WebActivator.ActivationManager threw an exception
with the following error message: Could not load type
'System.Runtime.CompilerServices.ExtensionAttribute' from assembly
'mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11556592
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
+141 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +4813333
None of my searching has turned up anything terribly helpful, but the main avenue I've explored is a potential conflict between the version of .NET that Ninject was built against and the version that I'm actually running. I've never installed .NET 4.5 on my system, so I'm certain that I'm building against 4.0. I then built the most recent version of Ninject (3.0.2) and the extensions from source to be sure that it's using 4.0 as well. I also tried adding all the libraries that I'm using in the real app to my test app to see if there's a conflict but that didn't turn up anything. (However, I didn't go so far as to put in code that exercises them. I don't know if that would change anything.)
Has anyone seen this kind of problem before or have any ideas that I can try? Is there more info I can provide that would be helpful?
Alternatively, is there some other way I can use Ninject in an ASP.NET application instead of the ninject.web extension? Would wrapping the Ninject kernel up in a singleton work just as well?

Resources