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!
Make sure you do not have multiple VS windows open, specifically of the same project! :)
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.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.
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.
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.
This resolved the warning condition and allowed me to debug once again.
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...
You can go to the Project Properties -> Build -> Advanced button -> Debug info drop-down and change its value to "full".