Hi there and thanks for the reply
To expand a little the error is as follows:
-----------------------------------------------
[SecurityExcepti on: That assembly does not allow partially trusted callers.]
BusinessLayer.e xRateFactory.Se rializeClass(ex Rate _exRate, String Path)
in exRateFactory.v b:91
BusinessLayer.e xRateFactory.Ge tExRate() in exRateFactory.v b:26
Test.Page_Load( Object sender, EventArgs e) in
D:\networkclub2 couk\wwwroot\we bservices\exRat e\Test.aspx.vb: 9
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +99
System.Web.UI.C ontrol.LoadRecu rsive() +47
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +6953
System.Web.UI.P age.ProcessRequ est(Boolean includeStagesBe foreAsyncPoint,
Boolean includeStagesAf terAsyncPoint) +154
System.Web.UI.P age.ProcessRequ est() +86
System.Web.UI.P age.ProcessRequ estWithNoAssert (HttpContext context) +18
System.Web.UI.P age.ProcessRequ est(HttpContext context) +49
ASP.test_aspx.P rocessRequest(H ttpContext context) +29
System.Web.Call HandlerExecutio nStep.System.We b.HttpApplicati on.IExecutionSt ep.Execute() +154
System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
completedSynchr onously) +64
-----------------------------------------------
exRateFactory and exRate are classes in the business layer. The two methods
which are called are GetexRate which basically sets a number of values on the
exRate class and SerializeClass which serializes the exRate class once the
values are loaded. Basically the exRateFactory either calculates new values
or takes the values from the serialized class according to certain perameters.
As far as I understand it when I build the solution the BusinesLayer.dl l is
copied to the bin foilder of the main application. The main application then
calls the classes from within the BusinessLayer.d ll. This works without issue
on the devlopment server.
When I upload the application to the Shared hosting environments all the
contents of the bin folder are copied to the bin folder on the live
application.
I'm assuming from the error message that the offending assembly is the
BusinessLayer.d ll
I have quite a few applications on this host built with the same basic
architecture (using BusinessLayer.d ll) buit have never come across this issue
before. As a result I am somewhet confused!
The development server and live server are set up as close to the same as
possible, same versions of ASP.Net etc but I have no control over the live
server as it is not mine. My hosting provider is however very helpfull.
I apologise if my explanations are muddled but despite reading several
articles on this im not entirly sure I fully understand the problems.
--
Regards
Martyn Fewtrell
"Steven Cheng[MSFT]" wrote:
Hi Martyn,
As for the problem you met, it is likely a typical .NET(ASP.NET) Code
access security issue. As the error message indicate some assembly not
allow partial trusted caller, I agree with Alvin that you should first
check which assembly is the exact one that raise this error. Normally in a
public service hoster(with restricted code access permission policy), this
is common issue. And it is not necessarily your assembly, but could be some
other assemblies(syst em assembies) your assembly uses that raise this
error.
Generally, at development time, since your ASP.NET application is running
under Full Trust policy, there won't raise such CAS problem. At publich
shared hoster, CAS policy is restricted, if your application has called
some privileged code(according to .NET CAS permission), it may raise some
error. As for the "strong-name" or "AllowPartially TrustedCallers"
attribute, it is a typical approach use to create a wrapper assembly which
call those privileged code and install it into GAC. Here is a good MSDN
article detailedly describe ASP.NET 2.0 code access security and how to
deal with some common issues. You can have a look:
#How To: Use Code Access Security in ASP.NET 2.0
http://msdn2.microsoft.com/en-us/lib...0017_wrappingp
rivilegedcode
If you have any more specific questions, please feel free to post here.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.