Shared Assembly

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello Everyone,

I have created a shared assembly and I installed it in GAC -- now I want to
use this shared assembly in my Web project. Can anyone help me with this --
i tried adding a reference to my project and specifying it in web.config as
follows:

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm:v1">
<dependentAssembly>
<assemblyIdentity name="WebSecurityBusinessObjects"
publicKeyToken="04a21a904cc5af93" culture="neutral" />
<probing privatePath="bin"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

I am still getting security exception.

Thanks for all the help in advance.

Yatin Patel
 
Hi,

Try to include it under Referenece in your solution explorer using add
referenece.

Cheers,

Jerome. M
 
Yatin what u can also do is to put the DLL files under ur BIN folder in
the wwwroot folder.
Hope it helps
Patrick
 
Hi,

Thanks for the reply but I have tried both ways:

1. by adding as a reference
2. by copying the dll under bin folder

no matter what i do, it still gives me the same error.

Yatin Patel
 
Hi,

Sorry for the delay -- here is the exact error:

Security Exception
Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.

Exception Details: System.Security.SecurityException: Security error.

Regards,
Yatin Patel
 
Yatin,
But ur Error seems to be a Security issue!!
Do u have access to the right folder and the BIN folder ur application
is trying to use?
Try checking if your ASPNET acct has the necesary permissions.
Patrick
 
Patrick,

Yes, I tried giving the rights also but still its giving me the same error.

Regards,
Yatin Patel
 
Hi Patrick,

I just found out that if I change the <trust> level to "Full" -- i am able
to access the assembly but if I change the <trust> level to "Medium" -- i get
the Securityexception error. As far as I know its not advisable to give Full
trust to the assemblies -- can you please let me know if I am doing anything
wrong here.

Regards,
Yatin Patel
 
Back
Top