简体   繁体   中英

Issue with sharing MasterPage between projects in Solution

My team has multiple web application projects that have common components. In order to keep from having multiple instances, we have setup a common source that contains common classes and web project. In the web project, we would have MasterPage, pages, and user's controls that are shared as linked files from the main web application. each of the shared projects are included as part of the solution. The solution builds successfully, but when I open the page of the web app, I'm getting server stating that "The type 'Common.Controls.Master' is ambiguous: it could come from assembly 'C:....\\bin\\Common.Controls.DLL' or from assembly 'C:....\\bin\\AppWeb.DLL'. Please specify the assembly explicitly in the type name."

The actual Common.master resides in the Common.Controls project at the root. The link file to the master page is in the AppWeb project.

I've looked for solution and found this How to share Master Pages between my projects which is pretty much what I'm doing.

Another option I found was What is the best way to share MasterPages across projects . I haven't tried the methods in this one.

I was certain that using the linked file would work.

Thanks in advance in helping me resolve this error.

I faced a very similar issue recently with a different shared class. Is it possible that the initial location of the MasterPage was under AppWeb project and then moved under Common.Controls project? In this case a build would not clean the previous dlls and would cause the error you are looking at. If this is the case, a simple manual deletion of all files under the bin folder of your projects and rebuild should solve the issue. I hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM