If you create a starter XF project using VS2017 and select UWP/Shared Project it no longer runs after upgrading to the XF v3 preview NuGet
App loads and runs
App12.UWP.exe!App12.UWP.App.InitializeComponent.AnonymousMethod__5_0(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) Line 53
at C:\Users\xxx\Documents\Visual Studio 2017\Projects\App12\App12\App12.UWP\obj\x64\Debug\App.g.i.cs(53)
System.ArgumentException: String cannot have zero length.
at System.Reflection.RuntimeAssembly.GetResource(RuntimeAssembly assembly, String resourceName, UInt64& length, StackCrawlMarkHandle stackMark, Boolean skipSecurityCheck)
at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name)
at Xamarin.Forms.Xaml.XamlLoader.GetXamlForType(Type type)
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: global::Xamarin.Forms.Xaml.XamlResourceIdAttribute("", "", typeof(global::App12.App))]
namespace App12 {
[global::Xamarin.Forms.Xaml.XamlFilePathAttribute("C:\\Users\\xxx\\Documents\\Visual Studio 2017\\Projects\\App12\\App12\\App12\\App" +
".xaml")]
public partial class App : global::Xamarin.Forms.Application {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "2.0.0.0")]
private void InitializeComponent() {
global::Xamarin.Forms.Xaml.Extensions.LoadFromXaml(this, typeof(App));
}
}
}
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.0.0.354232-pre3" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.0.1" />
</ItemGroup>
Microsoft Visual Studio Community 2017
Version 15.6.4
VisualStudio.15.Release/15.6.4+27428.2015
I have this too.
Same issue for me.
As a workaround, please enable XamlCompilation.
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
Thanks that worked.
Now I can investigate FlexLayout😀
This worked!
For others reading along, you can put this:
[assembly: XamlCompilation (XamlCompilationOptions.Compile)]
In the App.xaml.cs, between your Using statements and namespace
I can not reproduce this issue. Could one of you attach a failing project to this issue ? Thanks
@StephaneDelcroix Here you go: https://www.dropbox.com/s/jnmtzi7g4bnnmls/XamarinForms2395.zip?dl=0
It is just a new project updated to Xamarin Forms V3-pre3 on VS 15.6.6 like described in OP. Exception happens when running UWP project. I did delete the obj/bin directories from the UWP project to reduce size.
thx. can repro now
notes to self:
TargetPath
or the ManifestResourceName
metadata are assigned.I keep investigating
Adding DependsOnTargets="PrepareResourceNames"
to the XamlG
target fixes it for UWP. have to check the implication on other platforms
Hi @samhouts ,
The reported issue occurs in Xamarin Forms version above 4.2. Same issue occurs, is this a break. Kindly help on this issue.
Regards,
Devaraj S
@Devaraj-Sekar Can you please open a new issue? Thanks!
Most helpful comment
As a workaround, please enable XamlCompilation.