Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeLoadException in MagicOnion.OpenTelemetry with opentelemetry-1.0.0-rc1.1 #380

Closed
itn3000 opened this issue Nov 26, 2020 · 2 comments
Closed

Comments

@itn3000
Copy link
Contributor

itn3000 commented Nov 26, 2020

Overview

TypeLoadException occured when using MagicOnion.OpenTelemetry with latest opentelemetry package.
This is because OpenTelemetry's API changes.

Environment

  • dotnet-sdk: 5.0.0
  • MagicOnion.OpenTelemetry: 3.0.13
  • OpenTelemetry: 1.0.0-rc1.1

Steps to reproduce

  • create new project
  • add MagicOnion.OpenTelemetry-3.0.13 nuget package
  • add OpenTelemetry-1.0.0-rc1.1 nuget package
  • run following code
using Microsoft.Extensions.DependencyInjection;
using MagicOnion.OpenTelemetry;
using Microsoft.Extensions.Configuration;

namespace magiconiontest
{
    class Program
    {
        static void Main(string[] args)
        {
            var config = new ConfigurationBuilder().Build();
            new ServiceCollection()
                .AddSingleton<IConfiguration>(provider => config)
                .AddMagicOnionOpenTelemetry()
                ;
        }
    }
}

Expected Behavior

exit with code 0 and no output

Actual Behavior

following exception was out.

Unhandled exception. System.TypeLoadException: Could not load type 'OpenTelemetry.Trace.Configuration.TracerBuilder' from assembly 'OpenTelemetry, Version=1.0.0.1, Culture=neutral, PublicKeyToken=7bd6737fe5b67e3c'.
   at MagicOnion.OpenTelemetry.OpenTelemetryServiceCollectionExtensions.AddMagicOnionOpenTelemetry
   at MagicOnion.OpenTelemetry.OpenTelemetryServiceCollectionExtensions.AddMagicOnionOpenTelemetry(IServiceCollection services, MagicOnionOpenTelemetryOptions options)
   at MagicOnion.OpenTelemetry.OpenTelemetryServiceCollectionExtensions.AddMagicOnionOpenTelemetry(IServiceCollection services, String configurationName)
   at magiconiontest.Program.Main(String[] args) in D:\src\gitrepos\dotnet-sandbox\magiconiontest\Program.cs:line 16
@itn3000
Copy link
Contributor Author

itn3000 commented Nov 26, 2020

oh, I found MagicOnion.OpenTelemetry is deprecated package, I close this issue.

@itn3000 itn3000 closed this as completed Nov 26, 2020
@neuecc
Copy link
Member

neuecc commented Nov 26, 2020

OpenTelemetry package will publish on MagicOnion.Server.OpenTelemetry after #374 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants