Reputation: 129
I admit that I'm new to the world of xaml
but seeing warnings using the built-in Visual Studio templates indicate that there might be another issue besides my brain.
If I create an empty VSIX Project
(it has to be a VSIX Project) in Visual Studio using Add -> New Project
, and then proceed to create a new user control using Add -> New Item -> User Control (WPF)
, after I have compiled the code, the editor shows me the warning Ambiguous invocation
on the line InitializeComponent()
, as shown below:
There are warnings in the Designer view as well, shown below:
The warning is only present in the editor. Building the project is no problem, as shown below:
Please note that there are NO warnings if you add a User Control (WPF)
to a Class Library (.NET Framework)
project, as shown below:
If I look in the obj/Debug/
folder of SomeProject
I see two files for SomeControl
. The first is SomeControl.g.cs
, and the second is SomeControl.g.i.cs
. The files are identical.
The same goes for the obj/Debug/
folder of SomeOtherProject
, without the warning.
I have cloned various official Microsoft repos (e.g. UnitTestBoilerplateGenerator) and the warning is present here as well, for example in: src/View/CreateUnitTestBoilerplateDialog.xaml.cs at InitializeComponent()
, as shown below:
What's going on?? =(
This is using Visual Studio 15.4 and ReSharper 2017.2.2; I don't seem to be getting this warning with older versions of Visual Studio/ReSharper.
This seem to be a ReSharper specific problem, since after suspending ReSharper the warnings are no longer present. I have submitted a bug through ReSharper -> Help -> Report a Bug or Submit Feedback...
.
Upvotes: 4
Views: 1169
Reputation: 13533
It is a known issue for ReSharper 2017.2.x
Update: It was fixed in ReSharper 2017.3 version.
Upvotes: 3