"Symbols for the module MyLibrary.dll were not loaded"?

28,989

Solution 1

You can go to the Project Properties -> Build -> Advanced button -> Debug info drop-down and change its value to "full".

Solution 2

In Visual Studio I selected Build -> Clean Solution. That got rid of this message

Solution 3

I just fixed the same error. I went to Tools -> Options -> Debugging -> Symbols and pressed Empty Symbol Cache in Visual Studio 2013. Probably trashing your bin and obj folders does pretty much the same in a much less elegant way.

Solution 4

I was having this error when I had an assembly that was in the GAC and Visual Studio was not removing it before compile/debug. I was able to resolve it by removing that library (dll) from the GAC.

//if pokelib.dll contained assembly: PokeLibrary.Pokemon 
//and it showed up in the GAC (c:\windows\assembly\) with that assembly name
gacutil /u PokeLibrary.Pokemon

This resolved the warning condition and allowed me to debug once again.

Solution 5

You are debugging your code with an referenced dll that does not compiled for debug mode.

Compile referenced dll in debug and use it.

Check the referenced dll adresses to be sure you are using correct dll.

Share:
28,989

Related videos on Youtube

Benjin
Author by

Benjin

Software Engineer at Microsoft, focusing in UX and Security. Studied Software Engineering and Psychology at RIT, graduated from TJHSST.

Updated on May 06, 2021

Comments

  • Benjin
    Benjin about 3 years

    I'm trying to learn Windows Phone dev by making a basic app that provides information about Pokemon. To do this, I've created a portable class library (PokeLib.dll) so it's compatible with universal apps. I've tested this via a project in the same solution ("Test"), and it works fine. You can take a look at the code for these on my Github, but as far as I can tell, it's all good. These two projects are in the one solution. For the Windows Phone app's solution, I added PokeLib as an "existing project", added the references, and written some a couple lines of code to make sure I could call it okay:

    MainPage.xaml:

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
    
        <Button Name="GetDataButton" Content="GetData" Click="GetDataButton_Click" Grid.Row="0" HorizontalAlignment="Center"/>
        <TextBlock Name="DataText" Text="Click to get data" Grid.Row="1" Padding="10"/>
    </Grid>
    

    MainPage.xaml.cs:

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            p = new Pokemon(1); // gets data for Pokemon #1 (Bulbasaur)
        }
    
        Pokemon p;
        int counter = 0;
    
        private async void GetDataButton_Click(object sender, RoutedEventArgs e)
        {
            DataText.Text = "Fetching... Count: " + ++counter;
            if (counter == 1) // first time button's clicked
            {
                await p.Create(); // populates the data container
                DataText.Text = String.Format("Pokemon #{0}: {1}", p.Id, p.Name);
            }
        }
    

    When I try to run this on a phone emulator, I get the following message: . I am building the project as "debug" and have "Enable Just My Code" unchecked. I am not sure what to do under the Symbols pane, but I can add a screenshot of that too, if it'd be useful.

    Anyway, the app opens, but freezes when I press the GetData button. I expected it would freeze for a moment since that call is done synchronously, but this is permanent. However, no errors/exceptions are thrown. The debugger also doesn't respond when I attempt to step into the p.Create() call (likely stemming from the message in the screenshot).

    Anyone have an idea of what I'm doing wrong? Thanks!

    • Kevin Gosse
      Kevin Gosse over 9 years
      It's possible that there's a deadlock somewhere. You should await your call to p.Create instead of calling the Wait method. Waiting on the UI thread is bad practice anyway
    • Benjin
      Benjin over 9 years
      @KooKiz I know, I just wanted to get something proof-of-concepty working. I've updated the post with the latest code. It still hangs after pressing the button though, which I thought shouldn't be happening because the GetDataButton_Click method's now async.
    • Brandon Ward
      Brandon Ward over 8 years
      I realize that this question is bit old, but cleaning the solution and restarting VS resolved this error for me.
  • David says Reinstate Monica
    David says Reinstate Monica over 9 years
    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.
  • Ivan
    Ivan over 9 years
    I didn't want to critique or request clarification from an author. I just put solution that helped me to remove this message.
  • Adeem
    Adeem almost 9 years
    i am having the same problem, but why does it use from GAC, is there any work around instead of removing them from GAC?
  • tgolisch
    tgolisch almost 9 years
    Yes. If your source code matches the version in the GAC, you can debug it by using an exe to run/load the dll (from the GAC, not from your proj) and then you can use visual studio to "attach to process" (menu, tools, attach to process). However, if you make any changes to the code, you have to un/re GAC the dll anyway.
  • AH.
    AH. almost 9 years
    Thanks, but it didn't help me. Have a Silverlight project and a common project with a portable class library. The portable class library is shared between the silverlight client and another class library.
  • Dowlers
    Dowlers about 7 years
    One further step I had to do after removing the .dll from the GAC was a clean and build of the project.
  • Jitender Kumar
    Jitender Kumar about 7 years
    Didn't work. I am still having the same irritating message.
  • Dragos Durlut
    Dragos Durlut almost 7 years
    It worked for me. This is a reminder for me, for when this happens is the future. :) Also, debugging works as well.
  • Rich
    Rich almost 7 years
    I built each project individually that I thought may have been causing the issue and the message went away.
  • Cheese Bread
    Cheese Bread almost 7 years
    The opposite worked for me. Changing the drop down from 'full' to 'pdb-only'
  • Alessandro Lallo
    Alessandro Lallo over 6 years
    Worked for me. Thank you
  • Josh
    Josh over 5 years
    Didn't make any chance for me, an explanation of why this should work would be nice.
  • Hugo Quintela Ribeiro
    Hugo Quintela Ribeiro about 3 years
    What do you mean your "debugging in release mode"? :)
  • GabParrot
    GabParrot about 3 years
    Well, pressing start in visual studio with the combobox to its left toggled on release instead of debug. You wouldn't be able to access your breakpoints and it would yield that same error. I'm not sure of the correct words and names for this in English as my workplace has everything in French