radimitrov / CSharpShellApp

77 stars 18 forks source link

Type local:FloatToIntConverter not found in xmlns clr-namespace:XamlSamples #295

Closed KUNGERMOoN closed 1 year ago

KUNGERMOoN commented 1 year ago

When I try to compile this project on Windows in Visual Studio it runs without any problems, but when I try to compile it using this app, after compiling I get a runtime error: "Position 12:10. Type local:FloatToIntConverter not found in xmlns clr-namespace:XamlSamples"

(Note that to compile attached code on android (in this app), you'll need to create a new project and copy all .cs and .xaml files rather than copying entire project)

radimitrov commented 1 year ago

@KUNGERMOoN An issue with the XAML compiler. This appears to be caused by unimplemented types that are replaced by stubs with null returning methods. In this case Microsoft.Maui.Controls.Xaml.Internals.SimpleValueTargetProvider from Microsoft.Maui.Controls.Xaml.dll. I haven't yet managed to trick Visual Studio into including the assembly build with the full types.

KUNGERMOoN commented 1 year ago

Thanks for response, I can't wait to learn MAUI, but not being able to reference code in class outside x: namespace was a problem stopping me from doing so (for now I'll just code the UI in C# which I believe shouldn't have this problem)

I haven't yet managed to trick Visual Studio into including the assembly build with the full types.

You meant the C# Shell app? (or am I misunderstanding something?)

radimitrov commented 1 year ago

Visual Studio, yes. It is what is used to compile C# Shell and it is what in this context provides all the framework assemblies. And the one included will be loaded even if I pack another DLL in the assets for example

radimitrov commented 1 year ago

@KUNGERMOoN It's fixed. That was easier than expected. There should be an update by tomorrow.

KUNGERMOoN commented 1 year ago

@radimitrov I can confirm this bug no longer occurs. Thanks again!