24

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!

Benjin
  • 2,006
  • 2
  • 23
  • 41
  • 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 – Kevin Gosse Nov 29 '14 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 '14 at 19:03
  • 1
    I realize that this question is bit old, but cleaning the solution and restarting VS resolved this error for me. – Brandon Ward Feb 07 '16 at 00:19

15 Answers15

16

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

Ivan
  • 315
  • 2
  • 12
  • 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](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment). – David says Reinstate Monica Feb 12 '15 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 '15 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 '15 at 05:54
  • Didn't work. I am still having the same irritating message. – Jitender Kumar May 05 '17 at 06:44
  • It worked for me. This is a reminder for me, for when this happens is the future. :) Also, debugging works as well. – Dragos Durlut Jul 19 '17 at 11:43
  • The opposite worked for me. Changing the drop down from 'full' to 'pdb-only' – Cheese Bread Aug 14 '17 at 19:12
  • Didn't make any chance for me, an explanation of why this should work would be nice. – Josh Dec 11 '18 at 13:10
8

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

arame3333
  • 8,965
  • 19
  • 102
  • 191
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.

Departamento B
  • 7,754
  • 5
  • 33
  • 55
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.

tgolisch
  • 6,004
  • 3
  • 19
  • 37
  • 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 03 '15 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 06 '15 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 '17 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.

Ahmet Arslan
  • 3,649
  • 1
  • 23
  • 29
  • 1
    I built each project individually that I thought may have been causing the issue and the message went away. – Rich Jul 20 '17 at 14:15
1

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

Nick
  • 2,320
  • 1
  • 26
  • 36
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.

Dowlers
  • 1,256
  • 16
  • 26
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.

Dave Green
  • 11
  • 1
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.

Karthik Nishanth
  • 1,801
  • 1
  • 19
  • 28
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 )

Kaushik Thanki
  • 2,906
  • 2
  • 18
  • 40
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

chris31389
  • 5,798
  • 2
  • 44
  • 55
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...

Roshna Omer
  • 497
  • 1
  • 12
  • 19
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.

Jitender Kumar
  • 1,867
  • 2
  • 22
  • 40
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
Haseeb
  • 438
  • 4
  • 14
0

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

  • What do you mean your "debugging in release mode"? :) – Hugo Quintela Ribeiro May 05 '21 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 – GabTheParrot May 07 '21 at 12:03