类型或命名空间名称'模式'不存在命名空间存在'PartyInvites“ [英] The type or namespace name 'Models' does not exist in the namespace 'PartyInvites'

查看:222
本文介绍了类型或命名空间名称'模式'不存在命名空间存在'PartyInvites“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用VS2013临,TFS 2013防爆preSS

Using VS2013 Pro, TFS 2013 Express

我目前在做从书asp.net的MVC 5教程和一切都很好。
昨天我装了TFS 2013防爆preSS到我的本地机器,复制的项目转移到TFS文件夹,并添加该项目源控件​​。

I'm currently doing a tutorial from the book asp.net mvc 5 and everything was fine. yesterday I installed TFS 2013 Express onto my local machine, copied the project over to the TFS folder and added the project to source control.

由于这样做,我现在越来越喜欢这个问题的错误。在这种情况下,控制器仅仅具有使用

Since doing that I'm now getting errors like the subject. In this case the controller simply has a using:

using System.Web;
using System.Web.Mvc;
using PartyInvites.**Models**;

namespace PartyInvites.Controllers
{
    public class HomeController : Controller
    {
        // GET: Home
        //public ActionResult Index()
        //{
        //  return View();
        //}

        public ViewResult Index()
        {
            int hour = DateTime.Now.Hour;
            ViewBag.Greeting = hour < 12 ? "Good Morning" : "Good Afternoon";
            return View();
        }

        [HttpGet]
        public ViewResult RsvpForm()
        {
            return View();
        }

        [HttpPost]
        public ViewResult RsvpForm(**GuestResponse** guestResponse)
        {
            //todo: Email response to the party organizer
            return View("Thanks", guestResponse);
        }
    }
}

在HttpPost,对象GuestResponse就是红线,但是这个对象模型命名空间等的修改的红线也对模式一词在IS using语句在顶部。

in the HttpPost, the object "GuestResponse" is where the red line is, but this object IS in the models namespace etc. EDIT The red line is also on the word "Models" in the using statement at the top.

现在我发现,如果我删除解决方案文件夹的SUO文件并打开错误消失的解决方案,但只要我保存解决方案,然后重新打开错误回来。我也注意到这个同样的问题,是一对夫妇,我知道工作的其他项目。

Now I've noticed that if I delete the SUO file from the solution folder and open the solution the error goes away, but as soon as I save the solution and reopen it the error comes back. I've also notice this same problem is a couple of other projects I know work.

另外 - 当我打造的解决方案,他们建立没有错误,但红线仍然存在。

Also - When I build the solutions they build with no errors, but the red lines are still there.

我认为这个问题是与SUO文件和TFS的解决方案适用于无TFS版本精绝,但我不能找到解决SUO和TFS。我是PC的唯一用户,并有充分的管理权限。

I think the problem is with the SUO file and TFS as the solution works absolutely fine in the None TFS version, but I can't find a solution to SUO and TFS. I am the sole user of the PC and have full admin rights.

Q)有谁知道如何解决这个问题,所以我没有删除该文件SUO所有的时间?

Q) Does anyone know how to solve this problem so I don't have to delete the SUO file all the time?

修改1

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace PartyInvites.Models
{
    public class GuestResponse
    {
        public string Name { get; set; }
        public string Email { get; set; }
        public string Phone { get; set; }
        public bool? WillAttend { get; set; }
    }
}

编辑2

现在我已经试过文件> SourceControl>更改源代码控制,从源头控制到取消绑定,并且它现在按预期工作......但它现在不是在源代码控制。我想现在这个问题已经降到了相关的TFS。 - 更新。重新绑定回TFS之后,再次出现问题。

I've now tried to FILE>SourceControl>Change source control to Unbind from source control, and it's now working as expected... but it's now not in source control. I think this issue is now down to TFS related. -- Update. After rebinding it back to TFS, the problem returns.

推荐答案

我终于发现,工作一个答案。它在VS2013中的错误引起的问题,下面是有答案的链接。

I've finally found an answer that worked. It's a bug in VS2013 that is causing the problem, below is the link with the answer.

但在短期,关闭获取的一切,当一个解决方案或项目是开放的解决了这个问题,虽然不是一个完整的修补程序,但对我来说解决了这个问题。

but in short, turning off the "Get everything when a solution or project is open" solves the problem, though not a complete fix, but for me it solved the problem

<一个href=\"http://connect.microsoft.com/VisualStudio/feedback/details/760443/visual-studio-2012-ide-loses-intellisense-and-reference-resolution\" rel=\"nofollow\">http://connect.microsoft.com/VisualStudio/feedback/details/760443/visual-studio-2012-ide-loses-intellisense-and-reference-resolution

希望这会帮助别人。

这篇关于类型或命名空间名称'模式'不存在命名空间存在'PartyInvites“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆