23

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!

3
  • 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 Nov 29, 2014 at 18:41
  • @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.
    – Benjin
    Nov 29, 2014 at 19:03
  • 1
    I realize that this question is bit old, but cleaning the solution and restarting VS resolved this error for me. Feb 7, 2016 at 0:19

15 Answers 15

16

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

7
  • 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. Feb 12, 2015 at 17:52
  • 8
    I didn't want to critique or request clarification from an author. I just put solution that helped me to remove this message.
    – Ivan
    Feb 13, 2015 at 14:38
  • 1
    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.
    – AH.
    Jul 24, 2015 at 5:54
  • Didn't work. I am still having the same irritating message. May 5, 2017 at 6:44
  • It worked for me. This is a reminder for me, for when this happens is the future. :) Also, debugging works as well. Jul 19, 2017 at 11:43
9

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

0
5

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.

1
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.

3
  • i am having the same problem, but why does it use from GAC, is there any work around instead of removing them from GAC?
    – Adeem
    Jul 3, 2015 at 15:23
  • 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.
    – tgolisch
    Jul 6, 2015 at 12:28
  • One further step I had to do after removing the .dll from the GAC was a clean and build of the project.
    – Dowlers
    Mar 21, 2017 at 21:34
2

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.

1
  • 1
    I built each project individually that I thought may have been causing the issue and the message went away.
    – Rich
    Jul 20, 2017 at 14:15
1

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

1

In my case I had another version of the application running that was using the same .dll. This prevented the GAC getting updated with the debug version. I had the kill the process through task manager.

1

The only way that I can get around this message is to go to Debug > Options and Settings > Debugging > Symbols, and then selecting the radio button named 'All Modules, unless excluded.'

I'm not sure that this is the ideal workaround, but it's working for now.

0

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.

0

I found that the project I was receiving the message about, was being optimized when built.

I went into the projects properties, Compile Tab, Advanced Compile Options... and unchecked the Enable Optimizations checkbox

DeselectEnableOptimizations

0
  1. close visual studio.
  2. Performed quick cleanup using cclener.
  3. Clean solution & Rebuild project

& this worked for me. ( I really don't know how )

0

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...

0

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.

0

I just followed the below steps and the message disappear!

  1. Deleted all \Bin & \Debug folders under solution folder/sub-folder
  2. Clearnup solution (Right click on solution to choose "Clean Solution")
  3. Build/Rebuild solution
  4. Finish
0

Make sure you are debugging in Debug mode, not Release mode

2
  • What do you mean your "debugging in release mode"? :) May 5, 2021 at 21:57
  • 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
    – GabParrot
    May 7, 2021 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.