Skip to content

Mono.Cecil.Cil.SymbolsNotMatchingException warning #2120

Closed

Description

@deakjahn

The following two warnings appeared in XF/Android projects right after upgrading to VS 15.8.2:

  • Mono.Cecil.Cil.SymbolsNotMatchingException: Symbols were found but are not matching the assembly

  • Failed to read '...\obj\Debug\MonoAndroid81\android\assets\Mono.Android.dll' with debugging symbols. Retrying to load it without it. Error details are logged below.

The project compiles and runs fine.

Steps to Reproduce

  1. Open a project
  2. Build it

Expected Behavior

No warning.

Version Information

VS 15.8.2

Activity

  1. AngeloLazzari commented on Sep 6, 2018

    @AngeloLazzari

    same problem on VSC 7.6.3

  2. loic-git commented on Nov 14, 2018

    @loic-git

    Same problem on VSC 7.6.7

  3. tickerman commented on Nov 14, 2018

    @tickerman

    Im having The same Issue in Xamarin forms project , Visual Studio after Updating to 15.9

    Severity Code Description Project File Line Suppression State
    Warning Mono.Cecil.Cil.SymbolsNotMatchingException: Symbols were found but are not matching the assembly
    at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader, Boolean throwIfSymbolsAreNotMaching)
    at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
    at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters)
    at Mono.Cecil.ModuleDefinition.ReadModule(Disposable`1 stream, String fileName, ReaderParameters parameters)
    at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
    at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
    at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.ReadAssembly(String file)

  4. moustafashaban commented on Nov 23, 2018

    @moustafashaban

    same issue here

  5. xufeipyxis commented on Nov 23, 2018

    @xufeipyxis

    I'm having this issue in VS15.9.2

    warning : Failed to read 'D:\is.Android\obj\Debug\81\android\assets\uore.dll' with debugging symbols. Retrying to load it without it. Error details are logged below.
    warning : Mono.Cecil.Cil.SymbolsNotMatchingException: Symbols were found but are not matching the assembly
    warning :    at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader, Boolean throwIfSymbolsAreNotMaching)
    warning :    at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
    warning :    at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters)
    warning :    at Mono.Cecil.ModuleDefinition.ReadModule(Disposable`1 stream, String fileName, ReaderParameters parameters)
    warning :    at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
    warning :    at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
    warning :    at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.ReadAssembly(String file)
    
    

    The app builds and runs fine but I can't set a breakpoint in my code.

  6. shao200 commented on Nov 28, 2018

    @shao200

    I'm having this issue in VS15.9.2
    Mono.Cecil.Cil.SymbolsNotMatchingException: Symbols were found but are not matching the assembly
    在 Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader, Boolean throwIfSymbolsAreNotMaching)
    在 Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
    在 Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters)
    在 Mono.Cecil.ModuleDefinition.ReadModule(Disposable`1 stream, String fileName, ReaderParameters parameters)
    在 Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
    在 Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
    在 Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.ReadAssembly(String file)

    Failed to read 'D:\CoorIdentityMobile\CoorIdentityMobile\CoorIdentityMobile.Android\obj\Debug\81\android\assets\CoorIdentityMobile.dll' with debugging symbols. Retrying to load it without it. Error details are logged below.

    symbols not display!

  7. cat-prices commented on Nov 28, 2018

    @cat-prices

    I get this issue (since updating to VS15.9.2) and it seems a clean and rebuild fixes the issue (temporarily).
    As soon as you make a change the source files are out of date and no more working breakpoints.

  8. Alex-Witkowski commented on Dec 5, 2018

    @Alex-Witkowski

    Same behavior as @codan-prices with VS15.9.3 . This kills productivity when working on Forms :(
    @pierceboggan are you aware of this bug?

  9. Alex-Witkowski commented on Dec 5, 2018

    @Alex-Witkowski

    Okay seems like setting DebugType to full like mentioned in:
    xamarin/Xamarin.Forms#3137

    And after this manually deleting bin and obj folders of android and .NET Standard projekt helps to get debug working without clean every time. But VS still has some issues with highlighting the right lines (or especially only the lines where pointer stands) in editor.

  10. stesvis commented on Nov 5, 2019

    @stesvis

    I am having this issue now in VS 2019 16.3.7.
    Deleting bin and obj + rebuild all does not solve it.
    Any idea?

  11. ezverev commented on Dec 17, 2019

    @ezverev

    VS 2019 16.4.2 has this issue as well.

  12. MihaMarkic commented on Dec 27, 2019

    @MihaMarkic

    I'm getting a variation of this: "Mono.Cecil.Cil.SymbolsNotFoundException: No symbol found for file" but otherwise the message is the same.

  13. jitendrajadav commented on Mar 2, 2020

    @jitendrajadav

    After Migrating AndroidX I am having issue like below

    Severity Code Description Project File Line Suppression State
    Error Symbols were found but are not matching the assembly
    at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader, Boolean throwIfSymbolsAreNotMaching)
    at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
    at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters)
    at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
    at Xamarin.AndroidX.Migration.CecilMigrator.Migrate(String source, String destination)
    at Xamarin.AndroidX.Migration.CecilMigrator.Migrate(IEnumerable`1 assemblies)
    at Xamarin.AndroidX.Migration.BuildTasks.CecilfyFiles.Execute() KegID.Android C:\Users\jdj1.nuget\packages\xamarin.androidx.migration\1.0.0\buildTransitive\monoandroid90\Xamarin.AndroidX.Migration.targets 227

  14. hardikphd commented on Mar 2, 2020

    @hardikphd

    I have same issue after Upgrading Xamarin.Essentials to 1.5 from 1.4

  15. pmahend1 commented on Mar 12, 2020

    @pmahend1

    Same issue

  16. 10 remaining items

  17. bramborman commented on Apr 10, 2020

    @bramborman

    @dellis1972 but that still doesn't resolve the original issue I believe. I was getting the same warning when working on some app but I was not using any kind of obfuscation. Or is some kind of obfuscation on by default in new Xamarin.Android or Xamarin.Forms project? I mean in the default templates in Visual Studio for Windows.

  18. elpanas commented on May 1, 2020

    @elpanas

    It happens to me too, but as an error so I can't compile. it comes in Release only. Debug works without any problem

    EDIT:
    I've installed XamarinAndroidXMigration but nothing changed

    EDIT2:
    solved disabling dotfuscator, but it's not a real solution of course

    Symbols were found but are not matching the assembly
    in Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader, Boolean throwIfSymbolsAreNotMaching)
    in Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
    in Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters)
    in Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
    in Xamarin.AndroidX.Migration.CecilMigrator.Migrate(String source, String destination)
    in Xamarin.AndroidX.Migration.CecilMigrator.Migrate(IEnumerable`1 assemblies)
    in Xamarin.AndroidX.Migration.BuildTasks.CecilfyFiles.Execute() BeachuApp.Android

  19. dellis1972 commented on May 3, 2020

    @dellis1972
    Contributor

    @elpanas looking at your stack trace I believe you are hitting the following issues dotnet/android-libraries#8. I also believe that the team are looking into that problem.

  20. elpanas commented on May 9, 2020

    @elpanas

    @elpanas looking at your stack trace I believe you are hitting the following issues xamarin/AndroidX#8. I also believe that the team are looking into that problem.

    Top. Currently I think I've solved using this hint:

    https://github.com/xamarin/AndroidX/issues/8#issuecomment-572197993

    Building works but now the problem is that it gives me an error when I try to create the apk

    EDIT:
    I've solved even this
    cleaning solution,
    deleting bin and obj folder
    restarting VS
    Rebuilding the solution

  21. lunjio commented on May 10, 2020

    @lunjio

    In my case the problem comes on, only when dotfuscator is enabled. I tried cleaning, closing, opening, tried even to remove one by one a dotfuscator's hints i have in my project, but only disabling dotfuscator resolves an issue. My guess is that an obfuscation must run after all operations, before packaging an apk.

  22. elpanas commented on May 10, 2020

    @elpanas

    In my case the problem comes on, only when dotfuscator is enabled. I tried cleaning, closing, opening, tried even to remove one by one a dotfuscator's hints i have in my project, but only disabling dotfuscator resolves an issue. My guess is that an obfuscation must run after all operations, before packaging an apk.

    I've solved my first issue due to dotfuscator in this way: https://github.com/xamarin/xamarin-android/issues/2120#issuecomment-623097383 as suggested by dellis1972

  23. FranRDev commented on May 26, 2020

    @FranRDev

    In my case, it was by manually editing AndroidManifest.xml.
    I undid it, and made the changes through the project Properties menu.

  24. WeLoveJesusChrist commented on Jun 23, 2021

    @WeLoveJesusChrist

    The problem is in the name of the exception itself:
    "Mono.Cecil.Cil.SymbolsNotMatchingException" = symbol is not matching
    Meaning we changed something where Unity didn't re-sync.

    On the bottom of Unity Editor (the section where all your assets are), right click -> "Reimport All"

    Done.

    Like my post please because you know it's awesome smug

  25. ghost closed this as completedon Sep 27, 2022
  26. ghost locked as resolved and limited conversation to collaborators on Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    possibly-staleIssues that are potentially no longer relevant.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions