p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 4th, 2009, 03:02 PM
Registered User
Points: 14, Level: 1
Points: 14, Level: 1 Points: 14, Level: 1 Points: 14, Level: 1
Activity: 10%
Activity: 10% Activity: 10% Activity: 10%
 
Join Date: Oct 2009
Location: NYC
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to nqsousa
Unhappy Error using public class in App_Code: BC30002: Type 'xxx' is not defined

Hi,

I am experiencing a problem when deploying a website to IIS 7.0. I have no problem when running the website in VWD 2008 Express Edition (localhost).

The error occurs when I try to view a page which uses a code-behind file containing a reference to a public class(defined under a code file under App_Code folder).
page7.aspx uses page7.aspx.vb as its code-behind page
Contents of page7.aspx.vb page are:
Quote:
Imports Class2
Partial Class Page7
Inherits System.Web.UI.Page


Protected Sub LinkButton3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton3.Click
Response.Redirect("Default.aspx")
End Sub

Protected Sub LinkButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton2.Click
Dim class2_api As New Class2
class2_api.displayalert(TextBox1.Text)
End Sub
End Class
There's a file named Class2.vb in the App_Code folder that contains:
Code:
Imports Microsoft.VisualBasic
Imports System.Web.UI.Page

Public Class Class2
    Inherits System.Web.UI.Page
    Sub displayalert(ByVal msg As String)
        MsgBox(msg)
    End Sub
End Class
I am using the Copy Web Site functionality in VWD2008 Exp to deploy the website to a subfolder in inetpub (IIS 7.0) folder.

I have other test pages in website which work fine as long as there is no reference to a public class.

Any help would be greatly appreciated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old November 4th, 2009, 05:14 PM
Friend of Wrox
Points: 4,166, Level: 27
Points: 4,166, Level: 27 Points: 4,166, Level: 27 Points: 4,166, Level: 27
Activity: 12%
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,328
Thanks: 0
Thanked 1 Time in 1 Post
Default

What is the exact error message?

I believe the problem is that you are using a MsgBox(). MsgBox and MessagBox() will only display on the server, not the client pc. It works locally, because your PC is both the client and the server.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old November 6th, 2009, 06:20 PM
Registered User
Points: 14, Level: 1
Points: 14, Level: 1 Points: 14, Level: 1 Points: 14, Level: 1
Activity: 10%
Activity: 10% Activity: 10% Activity: 10%
 
Join Date: Oct 2009
Location: NYC
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to nqsousa
Smile BC30002: Type 'xxx' is not defined - Problem was solved

Hi jbenson001,
The problem occurred no matter what specific procedures or functions were inside the public class that I was trying to use.
In the meantime I solved it by doing the following:

a) I changed the location where I was deploying the site in IIS 7.0: before I had the site apart from the Default Web Site. I now have the site as a sub-folder of the Default Web Site. The website is also now defined as an Application (running under the DefaultAppPool)
b) I stopped the IIS server (stopped WorldWideWeb service), and changed start mode to manual
c) I restarted the machine
d) I deleted all files under folder C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET Files\ (I couldn't delete all until server had stopped) - this included some compiled files from the Visual Studio 2008 development testing
d) I changed WWW Service mode back to Automatic and restarted IIS Server
e) restarted Visual Studio 2008, built site, and published site to new location (under c:\inetput\wwwroot\<applicationfoldername>
The problem did not recur.

I think the issue was that for some reason the compilation of the website files upon publishing was not done properly when the site was defined in paralell with Default Web Site (as opposed to nder). It was probably in the configuration of the site itself. When you put the site working under the Default Web Site we benefit from all the inherited configurations that exist for the Default Web Site.
I also found useful deleting the temporary asp.net files. Later I did experience other error messages where it seems that the compiled files from opening the site from Visual Studio 2008, conflicted with the dlls from the compilation of the site into the IIS deployment and those errors would be solved by simply stopping the server, deleting temp files and restarting server.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classes in App_Code "not defined"!? LenexaKS ASP.NET 2.0 Professional 7 December 10th, 2007 02:23 PM
Error : BC30002: Type 'xxx' is not defined. cmualo ASP.NET 2.0 Basics 2 June 20th, 2007 09:25 AM
App_Code class compiled twice? xxx exists in both bigluzer General .NET 5 January 5th, 2007 03:45 PM
BC30002: Type 'OLEDBConnection' is not defined. athanatos ASP.NET 1.0 and 1.1 Basics 1 July 5th, 2006 10:03 PM
Saving a Public Property created in App_Code striker9 ASP.NET 2.0 Basics 1 June 8th, 2006 03:18 PM



All times are GMT -4. The time now is 08:09 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc