我正在使用Visual Studio 2013,您可能知道没有ASP.NET Web配置工具.我想要一直做快速角色等我尝试使用这篇文章启用它:http://blogs.msdn.com/b/webdev/archive/2013/08/19/asp-net-web-configuration-tool-missing -in-visual-studio-2013.aspx?PageIndex = 2#comments.但我收到"无效的应用程序路径"错误.解决此错误或解决方法的任何方法?
我试图像在这个线程中做同样的事情,但我得到错误:
"System.Collections.Generic.IEnumerable"不包含"添加",并没有扩展方法"添加"接受型"System.Collections.Generic.IEnumerable"的第一个参数的定义可以找到(是否缺少using指令或汇编参考?)
这是我的代码:
[HttpPost]
public ActionResult Create(ANIME anime)
{
var db = new MainDatabaseEntities();
var newanime = new ANIME
{
ID_AN = anime.ID_AN,
TITLE_OR = anime.TITLE_OR,
TITLE_EN = anime.TITLE_EN,
GENRES = new List<GENRES>()
};
foreach (var selectedAnime in anime.GENRES.Where(c => c.isSelected))
{
var genre = new GENRES { ID_GE = selectedAnime.ID_GE };
db.GENRES.Attach(genre);
newanime.GENRES.Add(genre); <--- this is the error line
}
db.ANIME.Add(newanime);
db.SaveChanges();
return RedirectToAction("Index");
}
Run Code Online (Sandbox Code Playgroud)
ANIME:
public partial class ANIME
{
public int ID_AN { get; set; …
Run Code Online (Sandbox Code Playgroud)