Compilation error when running ASP.NET application - asp.net

Getting this compile error when I debug the ASP.NET project. How do I add the reference properly?
Compilation Error
Description: An error occurred during
the compilation of a resource required
to service this request. Please review
the following specific error details
and modify your source code
appropriately.
Compiler Error Message: CS0246: The
type or namespace name 'BasePage'
could not be found (are you missing a
using directive or an assembly
reference?)
Source Error:
Line 8: namespace DisplayPage.UI
Line 9: { Line 10: public partial
class _Default : BasePage Line 11:
{ Line 12: protected void
Page_Load(object sender, EventArgs e)
I am using .NET 3.5 and vs 2008

what namespace is BasePage in?
I'm not quite sure how to make ASP.NET find classes from source files in the regular directory. I usually circumvent this problem by moving classes I want to access in that fashion into App_Code. Make sure you give it a namespace and import it.

Related

IIS ASP.NET Website using a web service compilation error

I am having the same exact problem described here:
Web service Compilation Error
But the answer is not detailed enough for me to try a fix. I cannot find a bin folder.
I connected to a web service using Add Service Reference in visual studio. I copied the entire folder to the IIS wwwroot folder including the App_WebReferences folder which was automatically added when adding the service reference.
Running the site right from visual studio works great.
Any help would be great. I'm using IIS 7.5.
UPDATE to show error:
FlightWS is the reference name I gave to the service when I connected it using the 'Add Service Reference' and pasted in the url of the wsdl file.
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'FlightWS' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 13: protected void Page_Load(object sender, EventArgs e)
Line 14: {
Line 15: FlightWS.AccountType user = (FlightWS.AccountType)Session["user"];
Line 16: if (user != null && !user.Equals(null))
Line 17: {
Source File: c:\inetpub\wwwroot\ServiceClient\Index.aspx.cs Line: 15
Show Detailed Compiler Output:
Show Complete Compilation Source:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237

"Type 'OracleConnection' is not defined." error in my ASP.NET application

I have an ASP.NET project which is working fine in my local host. But when I uploaded it to the web server I get this error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'OracleConnection' is not defined.
Source Error:
Line 11: Public NotInheritable Class OracleDao
Line 12: Inherits DataAccessObject
Line 13: Private m_connection As OracleConnection
Line 14: Private Dim s_connection As ConnectionString
Line 15: Private aliases As OracleType() = New OracleType() {OracleType.Number,OracleType.Number,OracleType.Char,OracleType.DateTime, _
Why is this happening?
problem caused by overzealous addition of permissions. Make sure the Role Members ‘db_denydatawriter’ and ‘deny_datareader’ are unchecked.

Weird ASP.net error that disappears on its own in a while

I have an ASP.net application that I'm running which works just fine, but sometimes I get the following error. And it resolves by itself too by just refreshing the page OR saving the page that's giving the error and then refreshing it. The error is :
Server Error in '/PinWW' Application.
Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.
Compiler Error Message: ASPNET: Make sure that the class defined in
this code file matches the 'inherits' attribute, and that it extends
the correct base class (e.g. Page or UserControl).
Source Error:
Line 16: Line 17: Line 18: public partial class LoginPage :
System.Web.UI.Page Line 19: { Line 20: private String connString
= "Data Source=DEVELOPMENT;Initial catalog=pin;uid=sa;Password=pass";
Cam anyone tell me WHY is this happening? I'm not changing anything on the page when it shows and error before saving it again and refreshing it when it works.

Why can't my app load MvcApplication?

I am having trouble running my asp.net mvc 2 app. using VS2010 ASP.NET Development Server.
error displayed in browser:
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'PrototypeB.MvcApplication'.
Source Error:
Line 1: <%# Application Codebehind="Global.asax.cs" Inherits="PrototypeB.MvcApplication" Language="C#" %>
Source File: /global.asax Line: 1
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
global.aspx.cs:
namespace PrototypeB
{
public class MvcApplication : System.Web.HttpApplication
{
...
Please copy paste the namespace in Global.asax file, right click on Global.asax and choose 'View Markup' to see it
https://forums.asp.net/t/1559469.aspx/1?Could+not+load+type+MvcApplication1+MvcApplication+
I just fixed the same problem just by copy pasting and recompiling solution.

Error compiling ASMX while accessing the web service

I have a ASMX web service. When I access it from a client the ASMX get compiled but I get this error:
Looking at csc.exe command line from the error detail the System.Windows.Forms asseembly is not referenced.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0234: The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)
Source Error:
Line 3: using System.ComponentModel;
Line 4: using System.Drawing;
Line 5: using System.Windows.Forms;
Line 6: using System.Xml;
Line 7: using Idp.Core.Configuration;
This problem can occur for at least two reasons:
The required assembly (in this case, System.Windows.Forms) is not referenced by your project. You can resolve this by adding the reference to your project in Visual Studio and, if required, redeploying the site.
The using statement is superfluous. Sometimes I wind up with unwanted using statements in my file. If it's unused, deleting line 5 should resolve the issue.

Resources