I want to add some code into my masterpage. So I removed the namespace but when I want to test it it gives this error. No idea how to fix this.
Error 2 The namespace 'Project' in 'c:\Users\Test\AppData\Local\Temp\Temporary ASP.NET Files\project\fe95a550\6aff5a12\assembly\dl3\9f54421a\e011b011_23bccd01\Project.DLL' conflicts with the type 'Project' in 'c:\Users\Test\AppData\Local\Temp\Temporary ASP.NET Files\project\fe95a550\6aff5a12\App_Web_exfemb4u.dll' c:\Users\Test\AppData\Local\Temp\Temporary ASP.NET Files\project\fe95a550\6aff5a12\App_Web_hrdlxq5l.4.cs 154
Masterpage.cs
public partial class Project: System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
Masterpage
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Project.master.cs" Inherits="Project" %>
Can you add a namespace before public partial ....
namespace Test
{
public partial class MovieMeter : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
Why did you remove the namespace ? please add one.
Replace:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Project.master.cs" Inherits="Project" %>
With:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Project.master.cs" Inherits="Project" %>
It might solve...
Then the reason for the error is due to the way these two attributes are handled:
CodeBehind: Needs to be compiled before being deployed and the compiled assembly is put in the bin folder of your website.
CodeFile: You deploy the source and it is compiled as it is needed. The compiled assembly is placed in the Temporary ASP.NET folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With