0

Here I decided to train on Xamarin. I am currently a tutorial. My problem is that when I try to add a ContentPage I only have the class file that is included in the project. If I display all the files of the project I see my view but can not include it in the project. I put you a screenshot below.

enter image description here

So if anyone has an idea of ​​where the problem may come from or a method to import my file I am a taker.

Thank you in advance.

Space
  • 124
  • 1
  • 13

2 Answers2

0

Stop your project before trying to include something on it with the Visual Studio interface.

Otherwise edit the .csproj manually, which is located on the root folder of your project and put the path to your new file manually like it's made on the others. You won't see the .csproj file with Visual Studio so use another editor instead.

See this link for more details about importing it manually

Dani
  • 187
  • 2
  • 7
0

Don't include .xaml and .xaml.cs files manually/separately, use the Add new class context menu instead (right click on Views folder) and select the kind of class you're interested in. The .csproj will automatically link the 2 created files like this :

<Compile Include="Views\MainPage.xaml.cs">
  <DependentUpon>MainPage.xaml</DependentUpon>
</Compile>

Your .csproj seems to be confused now, I suggest you don't try to edit it manually (for now), delete all CounterPage.* and start over.

Roger Leblanc
  • 1,543
  • 1
  • 10
  • 9