<p>Not entirely sure what's going on here; any help would be appreciated.</p>

<p>I'm trying to create a new .NET MVC web app. I was pretty sure I had it set up correctly, but I'm getting the following error:</p>

<pre><code>The type 'System.Web.Mvc.ViewPage' is ambiguous: it could come from assembly 
'C:\MyProject\bin\System.Web.Mvc.DLL' or from assembly 
'C:\MyProject\bin\MyProject.DLL'. Please specify the assembly explicitly in the type name.
</code></pre>

<p>The source error it reports is as follows:</p>

<pre><code>Line 1:  &lt;%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %&gt;
Line 2:  
Line 3:  &lt;asp:Content ID="indexContent" ContentPlaceHolderID="MainContentPlaceHolder" runat="server"&gt;
</code></pre>

<p>Anything stand out that I'm doing completely wrong?</p>

[{'answer_id': 48581, 'author': 'Dale Ragan', 'author_id': 1117, 'author_profile': 'https://Stackoverflow.com/users/1117', 'pm_score': 1, 'selected': False, 'text': '<p>This error usually indicates a class naming conflict.  You are referencing two namespaces or you created a class with the same name in another namespace that you are using.  I would start by looking at what that could be.</p>\n'}, {'answer_id': 48589, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 1, 'selected': False, 'text': '<pre><code> Inherits="System.Web.Mvc.ViewPage"\n</code></pre>\n\n<p>I\'d imagine that this should be pointed at your View codebehind file class, not at the base ViewPage class.</p>\n'}, {'answer_id': 48594, 'author': 'Dale Ragan', 'author_id': 1117, 'author_profile': 'https://Stackoverflow.com/users/1117', 'pm_score': 2, 'selected': False, 'text': '<p>Are you using a CodeBehind file, I don\'t see CodeBehind="" attribute where you are specifying the Inherits from?  Then you have to point inherits to the class name of the codebehind.</p>\n\n<p>Example:</p>\n\n<pre><code>&lt;%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="MvcApplication4.Views.Home.Index" %&gt;\n</code></pre>\n\n<p>Make sure the Inherits is fully qualified.  It should be the namespace followed by the class name.</p>\n'}, {'answer_id': 48597, 'author': 'chakrit', 'author_id': 3055, 'author_profile': 'https://Stackoverflow.com/users/3055', 'pm_score': 2, 'selected': False, 'text': '<p>I suppose you named one of your page "ViewPage" is that the case?</p>\n\n<p>And like @Jonathan mentioned, this smells:</p>\n\n<pre><code>Inherits="System.Web.Mvc.ViewPage"\n</code></pre>\n\n<p>On my MVC application, <em>all</em> the view pages have this instead:</p>\n\n<pre><code>Inherits="MySite.Views.Pages.Home"\n</code></pre>\n\n<p>Or something along the line. Your aspx page markup should have "Inherits" point to your code-behind class name, not the actual class that it is inheriting. The attribute name is rather misleading but its an artifact of earlier days.</p>\n'}, {'answer_id': 419280, 'author': 'Peter M', 'author_id': 33336, 'author_profile': 'https://Stackoverflow.com/users/33336', 'pm_score': 2, 'selected': False, 'text': '<p>I\'m running ASP.NET MVC Beta and also encountered this error. </p>\n\n<p>It came about while I was trying to remove the code behind file for a view. I removed the "CodeBehind" attribute in the @Page directive and changed the "Inherits" attribute to point to System.Web.Mvc.ViewPage, but left the actual aspx.cs code behind file untouched in my project.</p>\n\n<p>At this point, if I tried to run my project, I got the error you mentioned. </p>\n\n<p>I resolved this error by deleting the aspx.cs (code behind) file for the view from my project.</p>\n'}, {'answer_id': 1050259, 'author': 'Haacked', 'author_id': 598, 'author_profile': 'https://Stackoverflow.com/users/598', 'pm_score': 1, 'selected': False, 'text': "<p>Open up C:\\MyProject\\bin\\MyProject.DLL in Reflector and look for ViewPage to see if you've defined one by accident.</p>\n"}, {'answer_id': 7202990, 'author': 'Eric Herlitz', 'author_id': 296568, 'author_profile': 'https://Stackoverflow.com/users/296568', 'pm_score': 0, 'selected': False, 'text': '<p>No this should be a structural error message.</p>\n\n<p>Check <a href="http://trikks.wordpress.com/2011/08/26/the-type-is-ambiguous-it-could-come-from-assembly-or-from-assembly-please-specify-the-assembly-explicitly-in-the-type-name/" rel="nofollow">http://trikks.wordpress.com/2011/08/26/the-type-is-ambiguous-it-could-come-from-assembly-or-from-assembly-please-specify-the-assembly-explicitly-in-the-type-name/</a></p>\n'}, {'answer_id': 13310425, 'author': 'Paul', 'author_id': 1423534, 'author_profile': 'https://Stackoverflow.com/users/1423534', 'pm_score': 2, 'selected': False, 'text': '<p>Check your assembly references to <code>System.Web.Mvc</code> in <code>web.config</code>. </p>\n\n<p>Mine were explicitly specifying <code>2.0.0.0</code>, but my project referenced <code>3.0.0.0</code></p>\n'}, {'answer_id': 48819319, 'author': 'Ayson Baxter', 'author_id': 465941, 'author_profile': 'https://Stackoverflow.com/users/465941', 'pm_score': 0, 'selected': False, 'text': '<p>I had the same exact error this week.</p>\n\n<p>My Webform.aspx file had a generated designer.cs file. In this file the class was actually named "ViewPage". Delete the designer file, or move the class contents to the webform.aspx.cs file and my error was gone.</p>\n\n<p>Just putting it out there in case someone had this error.</p>\n'}]
['https://Stackoverflow.com/questions/48578', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1540/']