You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to render any page (even a newly created page with only a label inside) and using the PCLAppConfig NuGet, the Xamarin.Forms Previewer fails to render the controls since it tries to search for the App.config file and it doesn't find it.
As seen in the image below, I get a System.IO.FileNotFoundException when opening the Xamarin.Forms Previewer. This has the same behavior on any page and seems to come from the PCLAppConfig.FileSystemStream.AndroidAppConfigPathExtractor.get_Path() method called by PCLAppConfig.FileSystemStream.PortableStream.CreateAppConfigStream() method.
I do have the App.config file in both my Android and iOS projects but still it refuses to render my pages and controls.
I think the problem can be fixed by adding a design mode condition in the PCLAppConfig.FileSystemStream.PortableStream.CreateAppConfigStream() method so that it returns if we're in design mode and doesn't try to search for the file . You can use DesignMode.IsDesignModeEnable and use it as shown on this XAML Previewer page to make the Xamarin.Forms Previewer work again.
As a hint, you can open any XAML file in the Xamarin.Forms Previewer by right clicking the file, choose "Open with..." and then choosing "Xamarin.Forms Previewer". You can also set it as default if wanted to make some tests.
A fix would be really appreciated since me and my team would want to test the new capabilities of VS2019 to render pages and controls via the previewer. Thanks!
The text was updated successfully, but these errors were encountered:
When trying to render any page (even a newly created page with only a label inside) and using the PCLAppConfig NuGet, the Xamarin.Forms Previewer fails to render the controls since it tries to search for the App.config file and it doesn't find it.
As seen in the image below, I get a
System.IO.FileNotFoundException
when opening the Xamarin.Forms Previewer. This has the same behavior on any page and seems to come from thePCLAppConfig.FileSystemStream.AndroidAppConfigPathExtractor.get_Path()
method called byPCLAppConfig.FileSystemStream.PortableStream.CreateAppConfigStream()
method.I do have the App.config file in both my Android and iOS projects but still it refuses to render my pages and controls.
I think the problem can be fixed by adding a design mode condition in the
PCLAppConfig.FileSystemStream.PortableStream.CreateAppConfigStream()
method so that it returns if we're in design mode and doesn't try to search for the file . You can use DesignMode.IsDesignModeEnable and use it as shown on this XAML Previewer page to make the Xamarin.Forms Previewer work again.As a hint, you can open any XAML file in the Xamarin.Forms Previewer by right clicking the file, choose "Open with..." and then choosing "Xamarin.Forms Previewer". You can also set it as default if wanted to make some tests.
A fix would be really appreciated since me and my team would want to test the new capabilities of VS2019 to render pages and controls via the previewer. Thanks!
The text was updated successfully, but these errors were encountered: