This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 8209 - PCL Building and Debugging problematic in VS2012
: PCL Building and Debugging problematic in VS2012
Status: RESOLVED FIXED
Product: Android
Classification: Xamarin
Component: Visual Studio Plugin
: 4.3.x
: PC Windows
: --- normal
: ---
Assigned To: dean.ellis
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-11-04 10:29 EST by Stuart Lodge
Modified: 2013-07-08 04:25 EDT (History)
15 users (show)

See Also:
Tags:
Test Case URL:
External Submit: ---


Attachments

Description Stuart Lodge 2012-11-04 10:29:34 EST
I can build and debug PCLs with MonoDroid very well in VS2010

However, in VS2012 I am seeing a couple of problems:

- Often when I build a project then I need to do 2 builds - the first fails
with lots of errors (mostly to do with 'namespace not found' for namespaces
from the PCL library. However, the second build just works.
- When I try to debug a MonoDroid app which uses PCL then this debugging does
not hit breakpoints set within the PCL.
- When I try to debug a MonoDroid app which uses PCL then if I step into the
PCL, then the step fails to find the source code - so I just get the "no source
code available" view.

To repro this, try the MvvmCross vNext branch - e.g. TwitterSearch.

Also reported via -
http://forums.xamarin.com/discussion/286/pcl-debugging-in-vs2012
Comment 1 Stuart Lodge 2012-12-15 02:51:47 EST
Just to confirm this is still an active problem.

Is there any status on this bug?

Is this:
- not reproducible?
- reproducible but won't be fixed - no timeline set?
- reproducible but not a Xamarin issue - so we need to talk to MS instead?
- more information requested?
- rejected due to some other issue

Sorry, if this feels like pestering. I'm not trying to subvert or redirect
Xamarin engineering time - I love what you guys do. I am just trying to make
sense of what to do with my own time.

Thanks

Stuart
Comment 2 Jon Stoneman 2013-01-21 08:20:51 EST
I've not tried debugging with MonoDroid but can confirm that I've experienced
the same problem when doing builds.  Having cleaned the solution I've just had:

Build 1
Loading assembly "C:\git\MvvmCross\bin\WinRT\Debug\System.Windows.dll" failed.
System.IO.FileLoadException: Could not load file or assembly 'System.Windows,
Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of
its dependencies. Strong name validation failed. (Exception from HRESULT:
0x8013141A)

Build 2
Lots of namespace exceptions such as:
The type or namespace name 'Interfaces' does not exist in the namespace
'Cirrious.MvvmCross' (are you missing an assembly reference?)   
C:\git\MvvmCross\Cirrious\Cirrious.MvvmCross.Droid\Platform\MvxBaseAndroidSetup.cs
The type or namespace name 'IMvxViewModel' could not be found (are you missing
a using directive or an assembly reference?)   
C:\git\MvvmCross\Cirrious\Cirrious.MvvmCross.Droid\ExtensionMethods\MvxAndroidActivityExtensionMethods.cs

Build 3
No errors
Comment 3 dean.ellis 2013-03-13 15:03:01 EDT
Stuart, do you have a small sample we can use to replicate? I need to look at
setting up Android PCL support on my dev machine so I can test this out.
Comment 4 Stuart Lodge 2013-03-13 16:50:35 EDT
Sorry Dean.

Not really got one - as I don't do small samples :)

For PCL debugging any of the Mvx samples will fail - e.g. in
https://github.com/slodge/MvxTutorials

For build issues, go for the whole of Mvx vNext and then just try to build
TwitterSearch.UI.Droid ? You can then probably cut out projects once you've got
the repro?

Note: Build Issue 1 reported by JonStoneman above doesn't the same bug - that's
to do with the Mvx Build tree (I think) so I think can be ignored.
Comment 5 Stuart Lodge 2013-03-13 16:51:09 EDT
Changing status (someone has to)
Comment 6 rbxam 2013-04-08 16:25:24 EDT
Since the fist version of Xamarin.Android 2.0, i have the same Problem.

But in my environment, the breakpoint didn't hit in VS2010 "and" VS2012.
Comment 7 Glen Lawson 2013-04-21 03:20:01 EDT
I'm also experiencing the same issues Stuart outlined. 

It's a bit disappointing that the breakpoints aren't firing in PCL code. The
whole attraction of Xamarin for me is to to be able to take advantage of the
power of Visual Studio and associated workflows.
Comment 8 Lucian POPESCU 2013-04-25 07:42:18 EDT
Still no update on this issue? It is really annoying not being able to debug
PCLs. Is there someone else we should talk to or it is, in fact, a Xamarin
issue? 

Xamarin version 4.0.3.
Comment 9 Jason Steele 2013-04-25 11:06:04 EDT
This is killing me. Any idea when this will be resolved guys?
Xamarin.Android 4.6.04000 VS2012.

Thanks
Comment 10 Stuart Lodge 2013-04-25 11:19:42 EDT
Miguel has said that PCL support should arrive in approx 1 month.

I have no inside information about it.

Some words of caution:

- I would **guess** that there will be a couple of rounds of Alpha, then Beta
before it becomes Stable
- I would **guess** that this will arrive in Xamarin Studio first, and then
migrate to Visual Studio afterwards

Beyond that, I also have talked with one of the support guys about general VS
debugging issues - I know that they said they had fixed a number of problems
and that they were QAing those fixes. It might be worth one or more of us
pinging support by email to ask for a timeline on these fixes - it may be that
we don't need PCL support - we just need those other fixes.
Comment 11 dean.ellis 2013-05-02 09:05:59 EDT
I have been investigating this issue. It turns out that because the PCL
libraries do not use the Xamarin msbuild targets it does not generate the .mdb
files which are needed for debugging. 

I am working on a fix for this. Once completed the .mdb files will be generated
from the existing .pdb files that the PCL library produces. This will allow the
PCL libraries to be debugged.

Depending on the release cycle this fix may go into the Alpha or Beta channel.
Comment 12 dean.ellis 2013-05-02 12:18:22 EDT
Fixed in master/2fc29e9173
Comment 13 Jonathan Pryor 2013-05-28 12:22:48 EDT
*** Bug 9759 has been marked as a duplicate of this bug. ***
Comment 14 rlangton76 2013-06-25 17:41:40 EDT
Why does this say it's fixed yet it still doesn't work?  Is this not in the
release build yet?
Comment 15 Jonathan Pryor 2013-06-26 17:00:55 EDT
@rlangton76: Which version have you tried? The fix for this bug was in the
4.7.5 alpha release.

You might try the current 4.7.9 beta release or the current 4.7.11 alpha
release.

The fix for this will not be landing in the 4.6.x series.
Comment 16 Thomas Van Machelen 2013-07-08 04:25:28 EDT
I can confirm this is breakpoints are hit with the (now beta) 4.7.11 release.

Note You need to log in before you can comment on or make changes to this bug.