Thursday, April 24, 2008

VSxxxx 2003 Visual Studio Tips for Ambiguous Errors

Tips for ambiguous errors

Reference Issues - can not be found
P: C:\Inetpub\ApName\list.aspx.cs(26): The type or namespace name 'ToolBarControl' could not be found (are you missing a using directive or an assembly reference?)
A: Remove and re-add the references

Server Application Unavailable

P: The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
A: Are you running locally when the ap needs to run in the McCann domain? (i.e. accessing a web service


Q.) Not a valid solution/project file

A.) Make sure you are using VS 2003 (and double check the site is using 1.1)


Q.) Messed up paths for solution after you open projects


A.) Create a new solution, importing the projects from $/dir/ApplicationName

Q.) Error: “Machine to Application” ('MachineToApplication')

A.) Make sure that the Ap directory under root is configured as an application



Q.) Error: “The 'type' attribute must be set to a valid type name. (C:\Inetpub\ApName\web.config line 241)“ when AP tries to invoke the web service

A.) Missing DLL – try Microsoft.Web.Services2.dll” to the bin directory and other projects in the solution ref it


Q.) Error: The type or namespace name 'SomeRef' could not be found (are you missing a using directive or an assembly reference

A.) Remove and re-add the project reference for 'SomeRef’ to project



Q.) Error: The Type Or Namespace Name 'SomeRef’ cannot be found

A.) Make sure that the project SubName is in the solution, build it, in add a reference to its output for ParentProj

Q.) Error: The type or namespace name 'IISPWCHGLib' cannot be found

A.) Add reference to inter-op component Interop.IISPWCHGLib.dll.

Q.) Error: The type or namespace name ADSSECURITYLib cannot be found

A.) Add reference to inter-op component Interop.ADSSECURITYLib.dll


Q.) Error: Object reference not set to an instance of an object
1. Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:
if(ApPart.HasRight(Session,"Full Control") || Session["Role"].ToString() == " Administrator") {…

A.) Make sure that there is a copy of Microsoft.Web.Services2 in the bin directory for Ap (even if the reference is included in the project it appears not to be included in the project. Alternatively register this file in the GAC.)

B.) Make sure that “Allow Anonymous Access” is turned off @ the site level for the web site. [Website] [Properties] [Directory Security] [Edit] [Authentication Methods] uncheck [“Enable anonymous access”]


Q.) Error: A project of type class library cannot be started directly

A.) Set Ap as startup project and select a page (say, mgmt\addEmail.apsx) as the start page


Q.) Unable to open ApWebService

A.) Check the config (web.config & Ap.config) settings for the WS against a working version (say stage)

Q.) No error output, cannot debug

A.) Change web.config values for detailed errors and trace enabled to “true”

Q.) ICSharpCode.SharpZipLib

A.) http://www.icsharpcode.net/OpenSource/SharpZipLib/ may be required for some projects. (see $/ApName/Ancillary)


Q.) WSE 2

A.) Requires Web Services Enhancements 2.0


Q.) module 'Session' is : An error occurred during the processing of a configuration file required to service this request added again – The module session is already in the application

A.) cscript.exe adsutil.vbs SET /W3SVC/UploadReadAheadSize 512000

B.) Reboot



Q.) FPSE – Front Page Server Extensions

A.) Not needed



Q.) ASP.Net on local machine …

A.) Make sure aspnet (local machine) has access to c:\windows\temp\ per
http://msdn2.microsoft.com/en-us/library/aa302396.aspx


Q.) DLL defined multiple places (also – the type attribute must be set to a valid name)

A.) – Erase all content (project output) from the bin directory

B.) “The problem is that you may have other assemblies .i.e. dlls resulting form previous compiles.
You may have renamed your assemblies and thus you may have several name spaces visible.
The .NET framework cannot tell which namespace you are referring to in your \bin directory.
By deleting the offending .dlls (previous named assemblies) you will no longer get this error”


Q.) ASP .Net Version (1.0)

A.) Your IIS directory maybe set to 2.0 – change it to 1.1


Q.) Other & possibly “The remote name could not be resolved”

A.) May have a different hosts file that may/will cause issues trying to connect to remote servers via NetBios vs. IP address.



Q.) The type or namespace name 'ToolBarControl' could not be found (are you missing a using directive or an assembly reference?)

A.) Remove (delete) and re-add the project references. Also verify that the reference paths are for your local machine and not the values retrieved from VSS


Q.) In order to add this reference … ReferencePath property



A.) Say “Yes”



Q.) Error: “web application you are attempting to access on this web server is currently unavailable. Please hit the Refresh” or “Internal Server Error”

A.) Double check IIS set to 1.1, Reboot your machine


Q.) Deployment or “Secure Channel Support”

A.) To deploy I deployed to a local drive (only required files), then shared a dir on the Stage machine, copied the site output with xcopy, undid the share and worked remotely


Q.) Deployment & type attribute must be set to a valid type name.

A.) Use pre-existing stage config files

B.) Copied Microsoft.Web.Services2.dll to bin



Q.) SELECT permission denied on object 'ASPStateTempApplications' (SQL Session State)

A.) Need to enable SQL Server Session State for this login on this database

http://support.microsoft.com/kb/311209

If server is already configured for ss session state, add that (your) user as dbo for the [ASPState] db and [db_datareader] and [db_datawriter] for [tempDB]

No comments: