question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bogus warning when a `TopLevel` does not have a parameterless constructor

See original GitHub issue

Describe the bug If a TopLevel control does not have a parameterless constructor (e.g. because dependency injection is being used), the compiler emits this warning:

Avalonia warning AVLN:0005: XAML resource “avares://foo” won’t be reachable via runtime loader, as no public constructor was found

This warning is bogus for a TopLevel, because as the name suggests it can only be a root element of a XAML file. A compile error regarding this was already fixed in #2593.

According to blame, the warning was introduced as part of #9541.

Expected behavior No warnings are emitted when a TopLevel does not have a parameterless constructor.

Issue Analytics

  • State:open
  • Created 4 months ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kekekekscommented, May 10, 2023

. Any ideas how to teach msbuild task to respect NoWarn?

Pass NoWarn property as a task parameter

0reactions
lhsrebel72commented, Jul 16, 2023

@kekekeks any examples of this being done or guidleines on where and how to add this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a test data builder that works with classes without ...
Bogus example is var myObject = Faker.Generate<MyClass>(); . However, looks like both Bogus and NBuilder expect my classes to have parameterless ...
Read more >
Welcome to C# 10 - .NET Blog
It was an error for you to create a parameterless constructor on a struct. Starting in C# 10, you can include your own...
Read more >
cec.miamioh.edu/files/cpplint.py
IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES...
Read more >
Get error is "no parameterless constructor defined for this ...
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information ...
Read more >
Breaking changes in 7.0 | Elasticsearch Guide [7.17]
An Elasticsearch 7.0 node will not start in the presence of indices created in a version ... For existing pre-7.0 indices, a deprecation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found