Page will not compile in Visual Studio, but will display in the browser fine.

I am compiling a site that references the FreeTextBox.dll.  When I had the site running under windows server 2003 it was fine and would compile through visual studio without a problem.  I moved the website to Server 2008 and now the site will not compile through visual studio, but it will run in the browser fine.  I do not understand how IIS can complie the site at runtime without and error, but Visual Studio will not.  The error that I get when compiling is Unknown server tag 'FTB:FreeTextBox'.  I have made sure the dll is in the Bin directory.  I am not sure what to do.  I think it has something todo with Server 2008 becasue it compiles fine under server 2003.  

I am using Visual Studio Professional 2008 and the code is written in C#.
Any help would be greatly appericated.
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.

try putting this <add> tag in your web.config under the following location:

        <add assembly="FreeTextBox"
                tagPrefix="FTB" />

shanemayAuthor Commented:
Thank you for the reply,  I added the code to the Web.config file and still have the same issue.  I have the following code at the top of the page which uses the FreeTextBoxControl

<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>

It is really odd that the page will not compile, but will run fine.  
I've had this problem before - sometimes completely removing and then adding the reference to the DLL does it
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

shanemayAuthor Commented:
I removed the reference from the project completely, I removed the code that references the textbox and I recompiled the site with no problem.  I then reset the webserver, added the reference back into the project and added the text box to a different page and I still get the same error.  The page will display fine without error in the browser but it will not compile through Visual Studio.  How do you usually remove references to the DLL.  Maybe I am not completely removing it.  

Thank you for your help.
1) under references select DLL and remove. (if it's a website project instead of a web application project, you would go to application properties and select the references tab as deleting them from bin will not do it)
2) delete all <%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
3) delete all <add> tags in the web config that pertain to this control - as the example i gave you before
4) recompile with Rebuild All
6) on the toolbar, right click and select "Choose Items". then go to browse and open the DLL in question.
7) drag and drop the control from the toolbar to the application - VS will automatically add in everything it needs to use the control (refs, registration, etc)
shanemayAuthor Commented:
I followed the instructions and removed the reference and deleted the code that refernces the dll and FreeTextBox and recompiled the site with no problem.  I then added the reference through the Visual Studio GUI, I added the Code back for the TextBox and got the error again.  It seems strange that when I compile the code on server 2003 it works fine, but when compile on server 2008 it errors.  Do you think it could have something todo with IIS on Server 2008?
probably not IIS. is there perhaps a different version of the DLL on the server that works and on the machine with visual studio?
a version conflict could do this as well
shanemayAuthor Commented:
Becasue this is a testing environment, I am connection via fileshare directly to the test server for coding.  I do not have a local copy of website on my machine.  I only have one copy of the dll that I am using.  

Again, thank you for you help with this.  
so visual studio is on the same machine with IIS, using the same files and the same directory as IIS.
beats me.
try copying all of the files to another directory and creating another project that does not use files used by IIS
shanemayAuthor Commented:
This is about to drive me crazy.  I wrote another simple class and compiled it to a library and added the reference to the project.  I get the same error as I do with the FreeTextBox, however, it works fine on the page.  I think it has something to do with IIS 7.0, because when I move the project over to server 2003, the errors go away.  
shanemayAuthor Commented:
Some more information.  I have used the .net 2.0 configuration to add the assemblies as trusted with full control.  It is odd, because when I view the page in design view through Visual Studio 08, the assemblies display fine and their properties show in the properties side panel.  It just will not compile.  

Thanks for any help.
can you post the solution (or a new solution that just reproduces the problem) here, so I can download it and try to get it working in VS 2008?

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
shanemayAuthor Commented:
Thank you for the reply, I can not attach the entire solution, however, I have attached one page, and the dll's that are causing the error.  I also included the code that I placed inside of the web.config file to that the controls will work on the page.  In order to upload the files, I had to change the file extensions on the Custom_Validators and FreeTextBox files.  Just change the file extension back to .DLL.  I had to rename the aspx and aspx.cs files to text files, change the extensions on them as well.  Thank you for your help, please let me know if you have any questions.  The two
                <add tagPrefix="CBV" namespace="Custom.Validators" assembly="Custom_Validators"/>
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add assembly="FreeTextBox" namespace="FreeTextBoxControls" tagPrefix="FTB" />

Open in new window
shanemayAuthor Commented:
I have found a solution.  I needed to run the .net configuration on my work station and make the assemblies trusted from my machine.  This is despite the fact that the assemblies are on the server and are trusted on the server.  What a mess, I am glad this problem is over.  
shanemayAuthor Commented:
I am giving you the points becuase you were so willing to help, I really appreciate your advice.  I am glad this problem is solved,  I added another comment to the question with the solution.  Again, thank you.
I'm glad you figured it out, I learned something too.
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
.NET Programming

From novice to tech pro — start learning today.