我最近切换到Visual Studio 2019(以前是 2017 年)和Unity 2019.1.3f1(以前是 ~2019.1.0 某些东西),Tools for Unity在 Visual Studio 中使用 new并且我偶然发现了一个问题。
当我调试时,我看不到我的 Singleton 类中的变量(例如,GameManager.Instance.Var,Instance is public static)。如果我尝试通过立即窗口查看它,它会给我以下信息:
The identifier 'GameManager' is not in the scope
将鼠标悬停在它的任何部分(GameManager、Instance、Var)上根本不提供任何信息,CodeLens 无法使用它。
太糟糕了,因为现在我无法正确调试,只能Debug.Log大声笑...
帮助!我能做什么?好像找不到类似的问题。
这是我的设置图片Tools for Unity:
谢谢!
c# debugging unity-game-engine visual-studio visual-studio-2019
如何使用ASP.NET Core应用程序中的Entity Framework Core(代码优先)在SQL Server数据库中存储文件?
我尝试过使用Filestream但不幸的是我收到了这个错误:
无法在实体类型"UserProfile"上为属性"Avatar"调用Property,因为它已配置为导航属性.属性只能用于配置标量属性
这是代码:
public class UserProfile : BaseEntity {
public FileStream Avatar { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public DateTime DateOfBirth { get; set; }
public Sex Sex { get; set; }
public string Address { get; set; }
public string PhoneNumber { get; set; }
public virtual IEnumerable<Email> Emails { get; set; }
public virtual User User { get; set; …Run Code Online (Sandbox Code Playgroud) 我的App.xaml中有一个MenuFlyout:
<Application.Resources>
<MenuFlyout x:Key="LessonFlyout">
<MenuFlyoutItem Text="Edit"/>
<MenuFlyoutItem Text="Delete"/>
</MenuFlyout>
</Application.Resources>
Run Code Online (Sandbox Code Playgroud)
我想给MenuFlyoutItem click事件,但是编译器说我做不到。但是我需要一个单击事件,因此我搜索并发现可以将命令绑定到MenuFlyoutItem。
我的MenuFlyout将附加到不同页面中的不同对象。例如:
StackPanel thisSender = sender as StackPanel;
FlyoutBase.SetAttachedFlyout(thisSender, Application.Current.Resources["LessonFlyout"] as MenuFlyout);
FlyoutBase.ShowAttachedFlyout(thisSender);
Run Code Online (Sandbox Code Playgroud)
因此,当我单击MenuFlyoutItem时,它将需要调用我的函数。那么我该怎么做呢?
另一个很快的问题是,在有关MenuFlyout的正式Microsoft页面中,有人说MenuFlyoutItem有一个Icon属性,但是在我的情况下我没有,而VS则说有错误。
The member "Icon" is not recognized or is not accessible.
The property 'Icon' was not found in type 'MenuFlyoutItem'.
Run Code Online (Sandbox Code Playgroud)