Visual Studio - Can't publish website

I have a website (not web app) that I code and publish regularly using Visual Studio Publish.  The folder is called MyWebsite_v3.4.

I opened up a previous version called MyWebsite_v3.1 and this will not publish.  It builds fine and tests fine.  However, I can't publish without getting the following error:

Error      14      C:\Users\JOHN\AppData\Local\Temp\WebSitePublish\MyWebsite_v3.1 --1069655359\obj\Debug\AspnetCompileMerge\Source\controls\footer_print.ascx(88): error BC30554: 'controls_footer_print_notes_2' is ambiguous.      ASPNETCOMPILER      0      0      http://localhost/MyWebsite_v3.1/

Error      13      'controls_footer_print_notes_2' is ambiguous.      C:\Users\JOHN\AppData\Local\Temp\WebSitePublish\MyWebsite_v3.1--1069655359\obj\Debug\AspnetCompileMerge\Source\controls\footer_print.ascx      88      0      http://localhost/MyWebsite_v3.1/

I've tried the following:
1) Rebooting the computer many times
2) Deleting the temporary internet files in: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files (all versions)
3) Searching for another instance of 'controls_footer_print_notes_2'  (there is only one)

I've seen this problem before too when I take a copy of my colleague's code, make changes, zip it up and send it back to him.  When he unzips and tries to publish, he gets similar errors.

Any ideas?
robnhood00Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mark BullockQA Engineer IIICommented:
A solution on Experts Exchange was to add the namespace prefix to controls_footer_print_notes_2
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23037512.html
0
robnhood00Author Commented:
Sorry for the delay.  It took a while to test some of the things.   Changing the namespace prefix didn't help.
I was able to get it to publish by changing the publish options as show in the screenshot.

In the configuration for publish, for Merge Options,  I selected “Do not Merge. Create a separate assembly for each page and control”.

Then it worked. Any idea why this would work but the other options wouldn't work?
capture.PNG
0
Athar SyedCommented:
Having same named classes/objects in the a single assembly without specifying the complete namespace, will throw an error. However, when you create separate assemblies, then the compiler does the namespace naming when linking the assemblies.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.