我有Visual Studio 2012专业版.当我尝试打开特定的csproj时,我收到一条错误消息
此安装不支持项目类型.
它没有说明项目的"项目类型",也没有说明我需要安装什么才能打开它.
在检查.csproj文件时,我看到了这些行
<ProductVersion>9.0.30729</ProductVersion>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
Run Code Online (Sandbox Code Playgroud)
那么我需要安装什么才能打开这个项目?请提供链接!
我有一个 MVC4/Web API 项目,带有实体框架、代码优先数据模型。当我尝试使用数据上下文和模型创建具有读/写方法的新 API 控制器时,我收到一条警告,提示“对象引用未设置到对象的实例”。
我做了一些搜索,发现一些原因是 .csproj 文件中的项目类型 Guids 不正确、MvcScaffolding nuget 包的安装不完整以及安装 Powershell 3 的一个建议。
我已经确保我所有的项目类型 guid 都是正确的,确保正确安装了 MvcScaffolding 包,我什至安装了 Powershell 3。
这些都没有解决我的问题。我能想到的只是我的数据上下文/模型有问题,尽管它创建的表/关系很好。代码如下:
语境:
public class PropertySearchContext : DbContext
{
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Property>().HasRequired(p => p.Office).WithMany(o => o.Properties).HasForeignKey(p => p.OfficeId);
}
public DbSet<Office> Offices { get; set; }
public DbSet<Property> Properties { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
模型:
[Serializable]
public class Property
{
public int PropertyId { get; set; }
public string Address1 { get; set; } …Run Code Online (Sandbox Code Playgroud) entity-framework ef-code-first asp.net-mvc-4 asp.net-web-api visual-studio-2012