Error with Application Blocks for .NET

Topics: Data Access Application Block, General discussion
Mar 1, 2010 at 9:24 PM

In design mode I am getting a "ASP.NET runtime error:  could not load file or assembly 'Microsoft.ApplicationBlocks.Data' or one of its dependencies.  Access is denied" when trying to work on an application with a new computer.  I am running Windows XPSP3 and VS2008SP1.  The contractor who created this web application used MS Application Blocks for .NET (ver. 2.0).  After receiving my new computer at work I installed VS and the Application Blocks.  I moved my application solution files over to the new PC and put them in the exact same folder as was on the old PC.  When I opened my solution I began receiving this error on the top line of my .aspx pages:  <%@ Page Language="VB" MasterPageFile="~/Pages/_MasterPages/MainMasterPage.master" AutoEventWireup="false" Inherits="NCAGR.Application.WebGT.PresentationLayer.Grants" title="Web-GT: Grants" Codebehind="Grants.aspx.vb" %>.  I tried rebuilding the solution and re-adding the reference to Microsoft.ApplicationBlocks.Data but with no progress.  I have tried searching in a few of the forums and posted in a couple but have not come across a solution yet.  Since I had no problems on my old PC I am inclined to think that something isn't configured right on the new PC.  I came across this site while looking for answers.  I would appreciate any suggestions.  I might add that this is the first time I have worked with Application Blocks and a web application so you might have to break your suggestions down a little more simpler for me. 

Thanks,

Alex

Mar 1, 2010 at 11:28 PM

Hi,

Have you came across this one? http://forums.asp.net/p/1126567/1782094.aspx#1782094

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

Mar 2, 2010 at 7:08 PM

I had seen that one and I did try giving myself full permissions on the Temporary ASP.NET Files folder but it did not solve the problem.  If I don't receive any other suggestions then I may try adding the assembly to GAC.  It just seems like there should be another solution as I didn't have to do that on my old PC.

Thanks,

Alex

 

Mar 3, 2010 at 1:19 AM

You don't need to GAC the Data assembly.  The error message looks more like of permission issue but just to check, when you add that assembly as reference, is the Copy Local property set to true or false?  It should be true.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

Mar 3, 2010 at 5:58 PM

Thanks for your response.  I rechecked the properties and Copy Local is set to True.  Thanks for trying to help.

Alex

 

Mar 4, 2010 at 6:57 AM

Hi Alex,

Are you using impersonation in your config? This might be another hint : http://fabioscagliola.spaces.live.com/blog/cns!919F8FCDE3DC9AC4!155.entry

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

Mar 4, 2010 at 3:34 PM

Valiant,

Thanks for your response.  That was the culprit.  After I complete this enhancement I am working on I am going to have return to this website and read up on Enterprise Library.  I am supporting a contractor developed application so it has been challenging at times understanding what he did and why and how it works.  I appreciate your efforts in helping me find a solution.

Alex