Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2008-11-07
17
Medium Priority
?
556 Views
Last Modified: 2013-11-26
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.
0
Comment
Question by:shanemay
  • 9
  • 7
16 Comments
 
LVL 1

Expert Comment

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

<system.web>
    <pages>
      <controls>
        <add assembly="FreeTextBox"
                namespace="FreeTextBoxControls"
                tagPrefix="FTB" />
      </controls>
    </pages>
</system.web>

0
 

Author Comment

by:shanemay
ID: 22905266
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.  
0
 
LVL 1

Expert Comment

by:colonel720
ID: 22905320
I've had this problem before - sometimes completely removing and then adding the reference to the DLL does it
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:shanemay
ID: 22905798
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.
0
 
LVL 1

Expert Comment

by:colonel720
ID: 22905909
Usually:
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)
0
 

Author Comment

by:shanemay
ID: 22906165
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?
 
0
 
LVL 1

Expert Comment

by:colonel720
ID: 22906189
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
0
 

Author Comment

by:shanemay
ID: 22906273
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.  
0
 
LVL 1

Expert Comment

by:colonel720
ID: 22906370
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
0
 

Author Comment

by:shanemay
ID: 22931385
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.  
0
 

Author Comment

by:shanemay
ID: 22955229
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.
0
 
LVL 1

Accepted Solution

by:
colonel720 earned 2000 total points
ID: 22955991
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?
0
 

Author Comment

by:shanemay
ID: 22959483
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
            <controls>
                <add tagPrefix="CBV" namespace="Custom.Validators" assembly="Custom_Validators"/>
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add assembly="FreeTextBox" namespace="FreeTextBoxControls" tagPrefix="FTB" />
            </controls>

Open in new window

sample.zip
0
 

Author Comment

by:shanemay
ID: 22959724
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.  
0
 

Author Closing Comment

by:shanemay
ID: 31514365
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.
0
 
LVL 1

Expert Comment

by:colonel720
ID: 22959806
I'm glad you figured it out, I learned something too.
Thanks
0

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question