Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Xamarin is used to build an app on UWP, when it occurs "The name 'InitializeComponent' does not exist in the current context" error with XAML page.
It seems that the issue was fixed in v1.4 on Windows 8.1 though, is the fix also true for UWP?
Since Xamarin.Forms for UWP is still preview.
Thank you for your help.
Created attachment 14328 [details]
Project for reproducing this issue.
I have created a simple test project, that does not compile.
Problem is XAML page comes from a shared project.
I confirm the same issue, stuck to code only for now as XAML doesn't work.
Just ran into the same issue myself, and stumbled here. (using forms package 188.8.131.5213-pre4)
Same problem here. Just wanted to prot my Android Project to UWP and cnnot compile it.
Same problem here. Using Xamarin Forms and Visual Studio 2015 with a UWP project. I get this error when I try to deploy it. It has to be deployed before it can run in the simulator ...
Can someone right click .xaml file and execute "Run Custom Tool", I get "Error HRESULT E_FAIL has been returned from a call to a COM component.". I'm pretty sure it's related.
I see the same "The name 'InitializeComponent' does not exist in the current context" error with a Forms .xaml file in a shared project.
Reproduction steps that I use:
1) Create new "Blank App(Universal Windows) project in VS
2) Add Xamarin Forms NuGet to project
3) Add SharedProject to solution
4) Reference SharedProject from UWP project
5) Add new .xaml file to Shared Project, CrossPlatform->Forms Xaml Page
6) Run “Run Custom Tool" on file inside UWP project(App.xaml)
See exception I mentioned in Comment 6 and also 'InitializeComponent' missing error in Page1.xaml.cs file.
This is a duplicate of 33181. Please see here: https://bugzilla.xamarin.com/show_bug.cgi?id=33181#c30 for a workaround.
*** This bug has been marked as a duplicate of bug 33181 ***
- I have now filed Bug 39827 to provide a clean starting point for further discussion of the "'InitializeComponent' does not exist" _build_ error for Shared Projects combined with UWP projects. I will accordingly mark this bug as a duplicate.
- I have also now filed Bug 39826 for the issue with "Run Custom Tool" mentioned in Comment 6 and Comment 8. Somewhat surprisingly, it seems that that error is unrelated to the primary problem with "InitializeComponent".
## Additional information
According to my tests, the "'InitializeComponent' does not exist" _build_ error from this bug is slightly different from the IntelliSense error in Bug 33181. The problem in this case (Bug 36935) is that no `.g.cs` files are being generated for the XAML pages in the Shared Project during build. As mentioned in Comment 0, a similar issue was indeed resolved for Windows 8.1 projects in Xamarin.Forms 1.4.4 (Bug 29501).
*** This bug has been marked as a duplicate of bug 39827 ***
*** Bug 40405 has been marked as a duplicate of this bug. ***