Microsoft Application Blocks and Medium Trust??

  • Thread starter Thread starter Michael Howes
  • Start date Start date
M

Michael Howes

I'm upgrading a VS 2003/.Net 1.1 ASP.Net application to VS 2008/.Net 3.0

The application uses an older version of the Microsoft Data Blocks for
database access. The version in the Microsoft.ApplicationBlocks.Data.dll
is 2.0

The call to SqlConnection.Open() fails after I upgrade to .Net 3.0
The application runs under a tweaked version of Medium trust. After the
upgrade and the call to .Open() fails if I change the trust to Full the
call works.

Do I need to upgrade the version of the Application Blocks we are using
or is there a way to get this older version to run under medium trust in
..Net 3.0??

The call works in .Net 1.1 medium trust
The call works in .Net 3.0 full trust
It fails with .Net 3.0 medium trust

thanks
mike
 
Moving up to EnterpriseLibrary 4.0 is probably the next logical step.

But I think its strange you're getting the issue in the .Data DAAB.

...

Wait, are you one 3.0 or 3.5? It's either EnterpriseLibrary 3.1 or 4.0. I
don't know if you're in VS2008 but youre using 3.0 compatability.

...
 
Moving up to EnterpriseLibrary 4.0 is probably the next logical step.

This gets more complicated.
I don't know where the Microsoft.ApplicationBlocks.Data.dll comes
from. It's just in a bin folder in the project.
I think it came from "Enterprise Library for .NET Framwork 2.0 -
January 2006".

I just installed "Enterprise Library May 2007" which I think is
version 3.1. After install I did not fine a dll called
Microsoft.ApplicationBlocks.Data.dll
But I think its strange you're getting the issue in the .Data DAAB.

I don't understand the problem either. I do know that if I make the
call to SqlConnection.Open() it fails (after upgrading to .NET Framework
3.0) in Medium trust and works if I change to Full trust.
..

Wait, are you one 3.0 or 3.5? It's either EnterpriseLibrary 3.1 or 4.0. I
don't know if you're in VS2008 but youre using 3.0 compatability.
I'm building (upgrading to) .NET Framework 3.0
I think the version of the enterprise library is "Enterprise Library
for .NET Framwork 2.0 - January 2006" which is *before* 3.1

But as I just mentioned I just installed EnterpriseLibrary 3.1 and
don't see the dll we are using.

any help appreciated
mike
 
This example uses the DAAB 2.0.
http://sholliday.spaces.live.com/blog/cns!A68482B9628A842A!139.entry

This example
http://sholliday.spaces.live.com/blog/cns!A68482B9628A842A!176.entry
uses the EnterpriseLibrary 3.1.


Dll Name?
Microsoft.ApplicationBlocks.Data.dll is a compiled version of the DAAB 2.0.
(Pre EnterpriseLibrary)


//Quote//After install I did not fine a dll called
Microsoft.ApplicationBlocks.Data.dll//Quote//
That is correct.
Microsoft.Practices.EnterpriseLibrary.Data.dll will be the new one.



This is not a super trivial upgrade. The syntax is different. Use the
projects above to figure that out.


The issue is that you need to pay this price to get at the right level of
Enterprise Library for VS2008.


With the 2 projects, you can see a DAAB 2.0 version (for 1.1 code) and a
(upgraded newer version) of the EnterpriseLibrary with a VS2005 (2.0/3.0)
code.

That's alot better than nothing.


The EnterpriseLibrary is much more mature. And deals with the security
issues alot better.
You basically need to view the DAAB as a deprecated library, since its been
superceded by EnterpriseLibrary.


..........

Have a good weekend, I'm out.
 
This example uses the DAAB 2.0.
http://sholliday.spaces.live.com/blog/cns!A68482B9628A842A!139.entry

This example
http://sholliday.spaces.live.com/blog/cns!A68482B9628A842A!176.entry
uses the EnterpriseLibrary 3.1.


This is not a super trivial upgrade. The syntax is different. Use the
projects above to figure that out.

thanks!

it looks after a quick 15 minute glance that the old SqlHelper class
has been mostly replaced by the Database class. If that's true, I have a
lot of work ahead of me.
a lot of the calls look similar, PrepareCommand, ExecuteReader, etc

mike
 
You don't see what you're looking for because the structure of Enterprise
Library has changed. I strongly recommend you take some time to read the
part of their documentation that deals with Data Access.

Also, if you're using Visual Studio 2008, why _not_ use .NET 3.5 features
where they are useful? Neither .NET 3.0 nor .NET 3.5 make any changes to
..NET 2.0 code - they only add features. You will still be running the 2.0
CLR in either case, so why not get current?
 
Back
Top