简体   繁体   中英

Visual Studio Solution Explorer won't let me use / see new .xaml files

i am working on a project in Visual Studio, using Xamarin.Forms. I have a huge problem across all projects, and i cannot seem to solve it:

Every time i create a new item (a content page) it simply wont create the right structure. Instead of putting a .xaml.cs file into a .xaml, it just shows a .xaml.css file all by itself as seen below on Page1:

页面1仅显示xaml.cs文件,而不显示Page1.xaml

It does actually create a .xaml file as i can see it in the folder outside of Visual Studio:

我的文件浏览器的图片

The file named Page1 is a xaml file, it just wont show up in Visual Studio.

Furthermore, the .xaml.css file is completely useless without it, because the method

InitializeComponent(); 

now cant find its reference (even though it is there!)

If you are asking questions related to Visual Studio you supposed to mention version of it. Anyway this is not the better place to ask questions about Visual Studio specially when xamarin.forms have many known issues. In VS IDE itself you have option at top right side Send Feedback there you can take Screenshots & make a video of what exactly you are experiencing, From IDE itself you can directly post your bugs to Visual Studio Community . However the bug you have posted has already been registered to visual studio developer community . find a link here

Hope it help you

I came across the same problem today when I first started using Visual Studio with Xamarin. You can fix it by choosing the ".NET Standard" code sharing strategy when creating the project, not the "Shared Project" strategy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM