我正在尝试在我的 visual studio 代码中安装 .net core sdk。在使用 dotnet restore 命令安装 .net core sdk 后,我遇到了这样的问题。我该如何解决这个问题?
using System;
namespace BRT.BLL.Model
{
/// <summary>
/// Generic response model
/// </summary>
public class ApiResponse
{
//result status codes, 200,400..
public ApiResponse(int statusCode, object result, string type,
string message, bool isSuccess)
{
this.StatusCode = statusCode;
this.Result = result;
this.Type = type;
this.Message = message;
this.IsSuccess = isSuccess;
}
public int StatusCode { get; set; }
//dynamic data result
public object Result { get; set; }
//type of the dynamic data
public string Type { get; set; }
//custome message
public string Message { get; set; }
//if the request is successful or not
public bool IsSuccess { get; set; }
}
predefined type "system.Int32"is not defined or imported等相关问题
最佳答案
我经常在新项目中遇到这种情况。一个简单的清理、恢复 nuget 包和重建通常可以很好地修复它。如果您最近安装了新版本的 Net Core,它也有助于重新启动您的 PC。
关于.net - 如何修复 "the type or namespace name "系统“无法找到您是否缺少指令或程序集引用 (CS0246)”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57473140/