“Symbols for the module MyLibrary.dll were not loa

2019-04-03 07:12发布

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!

13条回答
时光不老,我们不散
2楼-- · 2019-04-03 07:12

Make sure you do not have multiple VS windows open, specifically of the same project! :)

查看更多
Rolldiameter
3楼-- · 2019-04-03 07:19

You can use DotPeek to generate PDB files for the library, then place it in the same folder as your dll. One more option, if the code is open-source, is to clone the repo, add the project to your project, add dependency, set build order and start debugging.

查看更多
何必那么认真
4楼-- · 2019-04-03 07:22

I also faced the same error and in my case the problem was because of web.config transformation file which I wanted to setup other than debug.config.

I had to track a bug using stage branch and therefore I setup the active solution configuration as Stage.

  • Go to the property option of your project solution
  • Click on Configuration Manager button on top right hand side.
  • Now drill down the drop down option active solution configuration and you choose configuration (web) file for your project to act on when you run it.

I had chosen the stage and when I build the project I got this error and because of that debuggers were become inactive.

But when I set the option back to debug, issue got resolved.

查看更多
来,给爷笑一个
5楼-- · 2019-04-03 07:24

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.

查看更多
趁早两清
6楼-- · 2019-04-03 07:26

this is how mine got fixed,

I had the same page open in two browsers and at first I choose 1st browser then 2nd browser fro debug without closing 1st browser, closing one of them fixed it...

查看更多
SAY GOODBYE
7楼-- · 2019-04-03 07:28

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

查看更多
登录 后发表回答