我正在使用.net 4.5.50938 Visual Studio Community 2013 V12.0.31101.00更新4 操作系统:Win 7 我正在尝试我从VS2012现有的网站复制到VS2013使用Visual 2013无法从其他部分类访问部分类.net C#
项目/解决方案使用Visual Studio我有一个实体模型从发生在我的“模型”文件夹中创建数据库,其中有部分“EntityClass1”类为一体的类。 现在我进入'App_Code'文件夹,并添加一个名为'EntityClass1'的类,并添加与'EntityClass1'使用的关键字相同的名称空间。但不像Visual Studio 2012,我无法访问EntityClass1的属性!
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MyProjectToVs2013.Models
{
using System;
using System.Collections.Generic;
public partial class EntityClass1
{
public System.Guid ID { get; set; }
public string Title { get; set; }
public System.Guid Class1ID { get; set; }
public virtual Entity34 Entity34 { get; set; }
}
}
,并在其他EntityClass1:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MyProjectToVs2013.Models;
using System.ComponentModel.DataAnnotations;
namespace MyProjectToVs2013.Models
{
public partial class EntityClass1
{
public EntityClass1()
{
//TODO: Add constructor logic here
}
public void createEntityClass1()
{
//here I am trying to access the properties and unlike VS2012
I cannot!! there is no such properties available via intelliSense:
Title // not appearing!
}
}
}
'createEntityClass1'是局部类之外。这根本无效。你不能有命名空间内的方法。 –
感谢您的答复,实际上这是一个错字,我编辑它。问题依然存在。 – Araz
您是否成功完成迁移?是否包含“csproj”文件? 。检查是否包含所有'cs'文件。你也应该打开'sln'文件。 –