CS1595 ‘…’ is defined in multiple places error when you use a user control

CS1595: ‘_ASP.FormsLoginPart_ascx’ is defined in multiple places; using definition from ‘c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\recruitment_selfservice\858213b9\9a24bb64\tyrklreb.dll’

I have this error often, because some .net webcontrols have the same file name, though they belong to different namespaces. I googled this a little bit and there are a few solutions.

  • change webcontrol .ascx name. asp.net compiler does not like same webcontrol file name.
    ex) AnotherCurrentDate.ascx
  • use classname attribute in control directive
    ex) <%@ Control Language=”c#” AutoEventWireup=”false” Codebehind=”CurrentDate.ascx.cs” Classname=”AnotherCurrentDate” Inherits=”MyProj.CurrentDate” %>

The idea is from velocity reviews thread


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s