locked
Why can't I Publish web site error CS0433: The type 'webapp4U.UI.Controls.Controls_MenuLeft' exists in both ? RRS feed

  • Question

  • User-663551687 posted

    Previously the program was written on VS2005, now I use VS2010 to run the program normally but when I publish the web site I get an error:

    It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

    error CS0433: The type 'webapp4U.UI.Controls.Controls_MenuLeft' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\nhadat_thi2\42a77785\d1e96df3\App_Web_danhmucbds.ascx.cc671b29.dll' and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\nhadat_thi2\42a77785\d1e96df3\App_Web_quangcaoleft.ascx.cc671b29.dll'...

    how do I fix the error? You see the attached file:

    http://www.mediafire.com/file/q583bdw8nx4lxqx/Web.config/file

    http://www.mediafire.com/file/4161930py8agvwg/App_Web_sej5mdlr.0.cs/file

    Tuesday, August 6, 2019 9:09 AM

All replies

  • User475983607 posted

    The error means IIS is not configured correctly or you published the application to a child folder of another application.  Create a virtual directory or application in IIS then publish your application.

    https://docs.microsoft.com/en-us/iis/get-started/planning-your-iis-architecture/understanding-sites-applications-and-virtual-directories-on-iis

    https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/sites/site/application/virtualdirectory

    Tuesday, August 6, 2019 10:12 AM
  • User-1038772411 posted

    Hello, dongtrien

    Troubleshoot your problem, please refer below microsoft official document it will help you.

    https://docs.microsoft.com/en-us/iis/publish/troubleshooting-web-deploy/troubleshooting-common-problems-with-web-deploy

    Thanks.

    Tuesday, August 6, 2019 10:24 AM
  • User1120430333 posted

    It seems to me that the problem is with the Usecontrol using a refernce to the .NET DLL for the aspx page that is also using the DLL too that is hosting the Usercontrol. .You're going to have to make the UserControl use the same refernce to the DLL as the aspx page is using

    .NET is telling you that there is an ambiguous refernce is being made to the DLL, and .NET can't make the decision as to what path to take in order to use the DLL 

    Tuesday, August 6, 2019 10:30 AM
  • User-663551687 posted

    I am using Windows 7 Ultimate 64 bit and SQL Server 2005, I think it is not an IIS error because when I press F5 in VS 2010 the program runs normally but when I press publish Publish web site I get an error. I cannot install Net 2.0 and Net 4.0, when I install Net 2.0 error: You must use "Turn window features On or Off" in the Control Panel to install or configure Microsoft .Net Framework 2.0 SP2. When I installed Net 4.0 the error message: Sam or higher version of .Net Framwork 4 has already been installed on this computer. I go to Control panel-> Programs and features-> Turn windows features On or Off. I do not see Net 2.0 and Net 4.0 to turn On, according to you need to install Net 2.0 and Net 4.0, previously VS 2005-based writing program using Net 2.0, now I switched VS 2010 using Net 4.0, while Net 2.0 error message, you see the attached image file http://www.mediafire.com/view/j19eosbedbuunlc/ControlPanel.jpg/file

    and some other errors:

    Message 1 Could not find schema information for the element 'http://schemas.microsoft.com/.NetConfiguration/v2.0:configuration'. E:\NhaDat2010\Backup\NhaDat\Web.config 

    Message 2 Could not find schema information for the element 'http://schemas.microsoft.com/.NetConfiguration/v2.0:configSections'. E:\NhaDat2010\Backup\NhaDat\Web.config 

    Message 3 Could not find schema information for the element 'http://schemas.microsoft.com/.NetConfiguration/v2.0:sectionGroup'. E:\NhaDat2010\Backup\NhaDat\Web.config

    Message 4 Could not find schema information for the attribute 'name'. E:\NhaDat2010\Backup\NhaDat\Web.config 

    Message 5 Could not find schema information for the attribute 'type'. E:\NhaDat2010\Backup\NhaDat\Web.config 

    Message 6 Could not find schema information for the element 'http://schemas.microsoft.com/.NetConfiguration/v2.0:sectionGroup'. E:\NhaDat2010\Backup\NhaDat\Web.config

    Message 7 Could not find schema information for the attribute 'name'. E:\NhaDat2010\Backup\NhaDat\Web.config

    Message 8 Could not find schema information for the attribute 'type'. E:\NhaDat2010\Backup\NhaDat\Web.config

    ...

    Error 105 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. E:\NhaDat2010\Backup\NhaDat\Web.config 58

    Wednesday, August 7, 2019 4:40 AM
  • User475983607 posted

    Error 105 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. E:\NhaDat2010\Backup\NhaDat\Web.config 58

    This error commonly points to IIS configuration.  Usually the web application is published to a folder that is not configured as a virtual directory or an application,   We also see this error when publishing to a folder within an existing application that again is not a virtual directory or application.

    The other error generally happen when there are errors in the code.

    Wednesday, August 7, 2019 10:44 AM
  • User-663551687 posted

    Other errors I fix and these 2 errors I haven't fixed yet:

    Error 1: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

    Error 2: error CS0433: The type 'webapp4U.UI.Controls.Controls_MenuLeft' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\nhadat_thi2\42a77785\d1e96df3\App_Web_danhmucbds.ascx.cc671b29.dll' and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\nhadat_thi2\42a77785\d1e96df3\App_Web_quangcaoleft.ascx.cc671b29.dll'...

    You can say step by step help me fix virtual directory IIS. I have already done but it is not possible, you can see my image file. http://www.mediafire.com/view/8znvv1re2y8wixn/virtual_directory_IIS6.jpg/file

    Thursday, August 8, 2019 2:34 AM
  • User-663551687 posted

    Does anyone know this error ? How do I edit it ? Just help me

    Tuesday, September 10, 2019 8:31 AM