question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.NET 7 - Internal CLR error (0x80131506) in dotnet ef cli

See original GitHub issue

File a bug

I tried to use dotnet ef cli for migrations and received Internal CLR error.

First, the error showed up in installing the dotnet-ef then I could fix it by reinstalling Microsoft.EntityFrameworkCore.Design. The second time the error occurred while I was trying to remove the migration.

dotnet tool install --global dotnet-ef --version 7.0.0

> dotnet tool install --global dotnet-ef --version 7.0.0
You can invoke the tool using the following command: dotnet-ef
Tool 'dotnet-ef' (version '7.0.0') was successfully installed.
Fatal error. Internal CLR error. (0x80131506)
Repeat 2 times:
--------------------------------
   at System.Diagnostics.Tracing.EventPipeInternal.Enable(Char*, System.Diagnostics.Tracing.EventPipeSerializationFormat, UInt32, EventPipeProviderConfigurationNative*, UInt32)
--------------------------------
   at System.Diagnostics.Tracing.EventPipeInternal.Enable(System.String, System.Diagnostics.Tracing.EventPipeSerializationFormat, UInt32, System.Diagnostics.Tracing.EventPipeProviderConfiguration[])
   at System.Diagnostics.Tracing.EventPipeEventDispatcher.CommitDispatchConfiguration()
   at System.Diagnostics.Tracing.EventPipeEventDispatcher.SendCommand(System.Diagnostics.Tracing.EventListener, System.Diagnostics.Tracing.EventCommand, Boolean, System.Diagnostics.Tracing.EventLevel, System.Diagnostics.Tracing.EventKeywords)
   at NewRelic.Agent.Core.Samplers.GCEventsListener.StartListening()
   at NewRelic.Agent.Core.Samplers.GCEventsListener.OnEventSourceCreated(System.Diagnostics.Tracing.EventSource)
   at System.Diagnostics.Tracing.EventSource.AddListener(System.Diagnostics.Tracing.EventListener)
   at System.Diagnostics.Tracing.EventListener.CallBackForExistingEventSources(Boolean, System.EventHandler`1<System.Diagnostics.Tracing.EventSourceCreatedEventArgs>)
   at NewRelic.Agent.Core.Samplers.GCEventsListener..ctor()
   at NewRelic.Agent.Core.DependencyInjection.AgentServices+<>c.<RegisterServices>b__1_2()
   at NewRelic.Agent.Core.DependencyInjection.AgentServices.StartServices(NewRelic.Agent.Core.DependencyInjection.IContainer)
   at NewRelic.Agent.Core.AgentManager+AgentSingleton.CreateInstance()
   at NewRelic.Agent.Core.AgentManager+AgentSingleton..ctor()
   at NewRelic.Agent.Core.AgentManager..cctor()
   at NewRelic.Agent.Core.AgentManager.get_Instance()
   at NewRelic.Agent.Core.AgentInitializer+CallOnce..cctor()
   at NewRelic.Agent.Core.AgentInitializer+CallOnce.TouchMe()
   at NewRelic.Agent.Core.AgentShim.Initialize()
   at NewRelic.Agent.Core.AgentShim..cctor()
   at NewRelic.Agent.Core.AgentShim.GetFinishTracerDelegate(System.String, UInt32, System.String, System.String, System.Type, System.String, System.String, System.String, System.Object, System.Object[], UInt64)
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, Void**, System.Signature, Boolean)
   at System.Reflection.MethodInvoker.Invoke(System.Object, IntPtr*, System.Reflection.BindingFlags)
   at System.Reflection.RuntimeMethodInfo.InvokeWithManyArguments(System.Reflection.RuntimeMethodInfo, Int32, System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Net.Http.SocketsHttpHandler.SendAsync(System.Net.Http.HttpRequestMessage, System.Threading.CancellationToken)
   at Microsoft.ApplicationInsights.Channel.RedirectHttpHandler+<SendAsync>d__4.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.ApplicationInsights.Channel.RedirectHttpHandler+<SendAsync>d__4, Microsoft.ApplicationInsights, Version=2.20.0.103, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<SendAsync>d__4 ByRef)
   at Microsoft.ApplicationInsights.Channel.RedirectHttpHandler.SendAsync(System.Net.Http.HttpRequestMessage, System.Threading.CancellationToken)
   at System.Net.Http.HttpClient+<<SendAsync>g__Core|83_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.Net.Http.HttpClient+<<SendAsync>g__Core|83_0>d, System.Net.Http, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<<SendAsync>g__Core|83_0>d ByRef)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(System.Net.Http.HttpRequestMessage, System.Net.Http.HttpCompletionOption, System.Threading.CancellationTokenSource, Boolean, System.Threading.CancellationTokenSource, System.Threading.CancellationToken)
   at System.Net.Http.HttpClient.SendAsync(System.Net.Http.HttpRequestMessage, System.Net.Http.HttpCompletionOption, System.Threading.CancellationToken)
   at Microsoft.ApplicationInsights.Channel.Transmission+<SendAsync>d__53.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.ApplicationInsights.Channel.Transmission+<SendAsync>d__53, Microsoft.ApplicationInsights, Version=2.20.0.103, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<SendAsync>d__53 ByRef)
   at Microsoft.ApplicationInsights.Channel.Transmission.SendAsync()
   at Microsoft.DotNet.Cli.Telemetry.PersistenceChannel.Sender.Send(Microsoft.DotNet.Cli.Telemetry.PersistenceChannel.StorageTransmission, System.TimeSpan ByRef)
   at Microsoft.DotNet.Cli.Telemetry.PersistenceChannel.Sender.SendLoop()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)

dotnet ef migrations remove

> dotnet ef migrations remove
Fatal error. Internal CLR error. (0x80131506)
Repeat 2 times:
--------------------------------
   at System.Diagnostics.Tracing.EventPipeInternal.Enable(Char*, System.Diagnostics.Tracing.EventPipeSerializationFormat, UInt32, EventPipeProviderConfigurationNative*, UInt32)
--------------------------------
   at System.Diagnostics.Tracing.EventPipeInternal.Enable(System.String, System.Diagnostics.Tracing.EventPipeSerializationFormat, UInt32, System.Diagnostics.Tracing.EventPipeProviderConfiguration[])
   at System.Diagnostics.Tracing.EventPipeEventDispatcher.CommitDispatchConfiguration()
   at System.Diagnostics.Tracing.EventPipeEventDispatcher.SendCommand(System.Diagnostics.Tracing.EventListener, System.Diagnostics.Tracing.EventCommand, Boolean, System.Diagnostics.Tracing.EventLevel, System.Diagnostics.Tracing.EventKeywords)
   at NewRelic.Agent.Core.Samplers.GCEventsListener.StartListening()
   at NewRelic.Agent.Core.Samplers.GCSamplerNetCore.Start()
   at NewRelic.Agent.Core.DependencyInjection.AgentServices.StartServices(NewRelic.Agent.Core.DependencyInjection.IContainer)
   at NewRelic.Agent.Core.AgentManager..ctor()
   at NewRelic.Agent.Core.AgentManager+AgentSingleton.CreateInstance()
   at NewRelic.Agent.Core.AgentManager+AgentSingleton..ctor()
   at NewRelic.Agent.Core.AgentManager..cctor()
   at NewRelic.Agent.Core.AgentManager.get_Instance()
   at NewRelic.Agent.Core.AgentInitializer+CallOnce..cctor()
   at NewRelic.Agent.Core.AgentInitializer+CallOnce.TouchMe()
   at NewRelic.Agent.Core.AgentShim.Initialize()
   at NewRelic.Agent.Core.AgentShim..cctor()
   at NewRelic.Agent.Core.AgentShim.GetFinishTracerDelegate(System.String, UInt32, System.String, System.String, System.Type, System.String, System.String, System.String, System.Object, System.Object[], UInt64)
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, Void**, System.Signature, Boolean)
   at System.Reflection.MethodInvoker.Invoke(System.Object, IntPtr*, System.Reflection.BindingFlags)
   at System.Reflection.RuntimeMethodInfo.InvokeWithManyArguments(System.Reflection.RuntimeMethodInfo, Int32, System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Net.Http.SocketsHttpHandler.SendAsync(System.Net.Http.HttpRequestMessage, System.Threading.CancellationToken)
   at Microsoft.ApplicationInsights.Channel.RedirectHttpHandler+<SendAsync>d__4.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.ApplicationInsights.Channel.RedirectHttpHandler+<SendAsync>d__4, Microsoft.ApplicationInsights, Version=2.20.0.103, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<SendAsync>d__4 ByRef)
   at Microsoft.ApplicationInsights.Channel.RedirectHttpHandler.SendAsync(System.Net.Http.HttpRequestMessage, System.Threading.CancellationToken)
   at System.Net.Http.HttpClient+<<SendAsync>g__Core|83_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.Net.Http.HttpClient+<<SendAsync>g__Core|83_0>d, System.Net.Http, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<<SendAsync>g__Core|83_0>d ByRef)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(System.Net.Http.HttpRequestMessage, System.Net.Http.HttpCompletionOption, System.Threading.CancellationTokenSource, Boolean, System.Threading.CancellationTokenSource, System.Threading.CancellationToken)
   at System.Net.Http.HttpClient.SendAsync(System.Net.Http.HttpRequestMessage, System.Net.Http.HttpCompletionOption, System.Threading.CancellationToken)
   at Microsoft.ApplicationInsights.Channel.Transmission+<SendAsync>d__53.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.ApplicationInsights.Channel.Transmission+<SendAsync>d__53, Microsoft.ApplicationInsights, Version=2.20.0.103, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<SendAsync>d__53 ByRef)
   at Microsoft.ApplicationInsights.Channel.Transmission.SendAsync()
   at Microsoft.DotNet.Cli.Telemetry.PersistenceChannel.Sender.Send(Microsoft.DotNet.Cli.Telemetry.PersistenceChannel.StorageTransmission, System.TimeSpan ByRef)
   at Microsoft.DotNet.Cli.Telemetry.PersistenceChannel.Sender.SendLoop()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
Build started...
Build succeeded.

Packages

    <ItemGroup>
        <PackageReference Include="Duende.IdentityServer" Version="6.2.0" />
        <PackageReference Include="Duende.IdentityServer.AspNetIdentity" Version="6.2.0" />
        <PackageReference Include="Duende.IdentityServer.EntityFramework" Version="6.2.0" />
        <PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="7.0.0" />
        <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" />
        <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.0" />
        <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0">
            <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
            <PrivateAssets>all</PrivateAssets>
        </PackageReference>
    </ItemGroup>

dotnet info

.NET SDK:
 Version:   7.0.100
 Commit:    e12b7af219

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.100\

Host:
  Version:      7.0.0
  Architecture: x64
  Commit:       d099f075e4

.NET SDKs installed:
  3.1.425 [C:\Program Files\dotnet\sdk]
  5.0.214 [C:\Program Files\dotnet\sdk]
  6.0.111 [C:\Program Files\dotnet\sdk]
  6.0.203 [C:\Program Files\dotnet\sdk]
  6.0.306 [C:\Program Files\dotnet\sdk]
  7.0.100 [C:\Program Files\dotnet\sdk]

_Forwarded from https://github.com/dotnet/efcore/issues/29769_

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
danmoseleycommented, Dec 12, 2022

@xsoheilalizadeh type Start>Add Remove Programs, look for New Relic, if it’s there try uninstalling it. Maybe ask at https://support.newrelic.com/

0reactions
danmoseleycommented, Dec 12, 2022

Maybe @noahfalk has an idea.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the meaning of the runtime error - internal CLR ...
I got the error 'internal clr error 0x80131506' and the program being debugged crashed. It's .NET Core 3.1 running on Windows 10 x64....
Read more >
Fatal error. Internal CLR error. (0x80131506) : r/csharp
-- I reinstalled VC Code and .NET, using the latest version for both and this did not work. I'm very new to programming...
Read more >
EF Core tools reference (.NET CLI)
Opens files generated by a command after the command is completed. Provides tab completion of commands, parameters, project names, context types ...
Read more >
c# Internal CLR error (0x80131506) caused by Regex. ...
The code that causes the exception belongs to a sortcomparer, which mimics the sort behaviour of the windows explorer. Most of the time...
Read more >
Fatal error. Internal CLR error. (0x80131506) during ...
Hi,. I'm debugging an asp.net 5 web application due to a strange issue. I have set my break point where I guess this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found