I just started updating all our client projects to .NET 4 and we are using WPF. All my views are inherited from a base class that extends UserControl, it is only a base class of code with one general argument of the type: BaseView. Before upgrading to .NET 4, I just pointed out x: TypeArgument and everything worked fine, but after upgrading now I get a NullReferenceException in the InitializeComponent () call. The xaml file has a value of "Page" and "MsBuild: compilation", I tried to set it to "Resource", as I read, but it is not even built. If I create a code file that inherits from it, say AddressView: BaseView, and use it, it works fine. Is there a way to continue to specify type arguments in my XAML file?
UPDATE: adding a deeper exception / stack trace: The object reference is not set to the object instance.
Stack trace:
in System.Windows.Markup.WpfXamlLoader.TransformNodes (XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, stack XamlContextStack`1, IStyleConnector styleConnector) in System.Windows.Markup.WpfXamlLoader.Load (XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings, Uri baseUri settings)
UPDATE 2: Perhaps you are right, I just updated a separate project and did not receive this error on the same machine inheriting from the same base class. Itβs super weird starting to remove items from the problem view in order to try to find the problem.
source share