.NET Framework - Problem with Database Access and ASPX pages
Asked By RDK
22-Jan-10 06:05 AM

I just installed the initial version of Expression Web (12.0.6211.1000) SP1
MSO (12.0.6425.1000) on my XP Pro SP3.
I have been using FrontPage for years. On this PC I have IIS running with FP
2002 extensions installed. I also have a Window 2000 Server also running FP
2002 extensions. My current development environment on my XP Pro machine
and also via the Server are both running fine for normal HTM and ASP pages,
including access to various SQL and Access databases.
I purchased Expression Web as the FrontPage replacement but never got around
to installing it until now.
Yesterday I tried to use Expression Web to create a simple database
connection page to just display items in an Access table. Code shown below:
=========================================
DataFile="Databases/PatsDB.mdb" SelectCommand="SELECT [Author],
[Title/subject] AS column1 FROM [BookReviews]">
===========================================
Normal HTM pages run fine but when I try to run this ASPX page on either my
local IIS site or from my Windows 2000 Server IIS site I get this error
message:
===========================================
Server Error in '/Pat' Application.
--------------------------------------------------------------------------------
Server cannot access application directory 'D:\Webs\wwwroot\Pat\'. The
directory does not exist or is not accessible because of security settings.
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.Web.HttpException: Server cannot access
application directory 'D:\Webs\wwwroot\Pat\'. The directory does not exist
or is not accessible because of security settings.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Server cannot access application directory
'D:\Webs\wwwroot\Pat\'. The directory does not exist or is not accessible
because of security settings.]
System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +72
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +263
[HttpException (0x80004005): ASP.NET Initialization Error]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +983
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +128
===============================================
What is going on and how do I correct it so I can continue looking at
Expression Web?....RDK
System.Web.HttpRuntime.ProcessRequestInternal
(1)
System.Web.HttpRuntime.FirstRequestInit
(1)
Expression Web
(1)
ASP.NET
(1)
IIS
(1)
XP
(1)
VSWebCache
(1)
HttpWorkerRequest
(1)
Andrew Murray replied to RDK
The errors you are getting seem to suggest the folder "Pat" does not exist but
I would say it is a mis-configuration on the server. Have you installed,
configured ASP .Net for your server(s)?
Can you try previewing the page in a browser (using the in-built development
server in EW) and make sure you have the settings for previewing ASPX pages
to on (under options > application settings or similar)? If the page loads
and functions correctly, you know it is a problem with your IIS
configuration.
I tried a Google search (search term: "Exception Details:
System.Web.HttpException: Server cannot access > application directory.")
and came across this: http://support.microsoft.com/kb/825789
Try the solution suggested and see if you continue to experience the errors
you have outlined.
I would also ensure you have the latest ASP .Net version (3.5)
Other members may have some ideas as they may be more expert in .Net and IIS
than myself.
Ronx replied to RDK
Which version of .NET is the website set up to use? The default is .NET
1.4, but Expression Web uses v 2.xxxxx
The stack trace indicates .NET is not correctly set up on the web server(s).
Apart from the set up problems, the page will not display anything - a
datasource points to the data, but you need something to display the data
in - a gridview, datalist, repeater etc.
So the page should be similar to: (I used a gridview in this example). Also
notice the language declaration, which EW will insert automatically if you
use new page and choose .aspx.
DataSourceID="AccessDataSource1">
SortExpression="AuthorID">
SortExpression="PageID">
DataFile="fpdb/rxs_data.mdb" SelectCommand="SELECT [AuthorID], [PageID] FROM
[Authorised_pages]">
--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp
Reply only to group - emails will be deleted unread.
RDK replied to Andrew Murray

Andrew and Ron....Thank you for your comments. As I am 100% new to
Expressions Web and .NET, I probably have not configured everything
correctly on my XP Pro development PC and on my Windows 2000 server, so any
hints would be very much appreciated.
For now I have only installed the original version of Expression Web (as
Indicated in my original post). I just now checked IIS on this XP Pro
machine and it had ASP.NET version 1.1.4322 in the dialog. I clicked on the
pulldown and selected 2.0.50727. I reconstructed my test page with a
datagrid as suggested and re-ran it. I got a similar error pointing to the
web.config file access problems.
==========================
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
Parser Error Message: An error occurred loading a configuration file: Failed
to start monitoring changes to 'D:\Webs\wwwroot' because access is denied.
Source Error:
[No relevant source lines]
Source File: D:\Webs\wwwroot\web.config Line: 0
==========================
I had read that MS Support link page before and could not find a VSWebCache
folder on my XP Pro PC. I did not check on Windows 2000 server as I want to
experiment with my XP Pro PC first.
Regarding ASP.Net installation, I have never done anything special with
ASP.Net. I have several updates which show up on my MS Updates list which
were installed automatically. Should I install/configure something else?
Also, I do not find any references to a way to preview my page in Expression
Web. From the File menu I can select Preview, but that just opens up a
browser and points to the server. What am I missing?
Thanks again for your help and patience.....RDK

then it figures out if this request has to be re-directed to a different web application. (It depends on request???s parameters) 3) If this request should not be re does not work because of the following problems: Problem 1: Without specifying the wrapping filter, IIS properly resolves default document name (which is my ISAPI extension DLL) , passes requests to the fine. But when I assign the wrapping filter (i.e. Application.Context.Response.Filter = new ???), IIS starts to verify existence of a resource specified in URL. The URL points to my ISAPI extension and, therefore, IIS does not find an existing file with such name. The error is:??? A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll Additional information: File does not exist.???. How to avoid such error? How to prevent IIS from checking existance of the resource when a wrapping filter is assigned to the request context.Response.Filter work. Any idea, why as soon as context.Response.Filter is assigned, IIS stops to understand that the specified URL should not be checked against physically present resources
first, but I didn't really = have a chance. My application was originally written in ASP.NET 1.1, but = was migrated to 2.0 during development. The reason this is an issue is = because the application is using the Microsoft.Web.UI.WebControls.dll = for the tree view and tab strip controls that didn't exist I have granted access every where that I = needed. Please assist. = 20 Here is the ASP.NET error message: Could not load file or assembly 'microsoft.web.ui.webcontrols' or one of = its dependencies. Access is denied. = 20 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 the code. = 20 Exception Details: System.IO.FileLoadException: Could not load file or = assembly 'microsoft.web.ui.webcontrols' or one of its dependencies. = Access is denied. Source Error: = 20 An unhandled
NET Framework Calling C++ library from ASP.NET web service I have a web service, written in C#, that calls a managed C++ library that itself calls a third allow me to call some unmanaged C++ from C#). When trying to compile / run the web service, I get the error: This application has failed to start because the application configuration from HRESULT: 0x800736B1) I copied the files: msvcm80d.dll, msvcp80d.dll, msvcr80d.dll into the web service's bin directory and now I get the error: The specified module could not click once application can both call the same library without any problems, and as the web service runs under the limited ASPNET account, that there is a permission problem that means found" error. Please note that a .NET application on the machine runs fine, but a web service doing pretty much the same thing (i.e. its calling the same methods in
NET Framework Wcf Rest Service can't run, can't load System.Web.Profile.DefaultP Hello, Environment is Windows 7 Ultimate N Visual Studo 2010 .Net 4.0 class is there. . .i'm not sure how it could be referencing another / incorrect system.web dll? Thanks, Karl - dying in singapore! its saturday ! Server Error in ' / ' Application. - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - Could not load type 'System.Web.Profile.DefaultProfile' from assembly 'System.Web, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a'. 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.TypeLoadException: Could not load type 'System.Web.Profile.DefaultProfile' from assembly 'System.Web, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the