|
|
 |
| 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.
|
 |

November 4th, 2009, 03:02 PM
|
|
Registered User
|
|
Join Date: Oct 2009
Location: NYC
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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. 
|

November 4th, 2009, 05:14 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,328
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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.
|

November 6th, 2009, 06:20 PM
|
|
Registered User
|
|
Join Date: Oct 2009
Location: NYC
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |