G
Guest
I have an assembly with some internal methods that I have to access from my
web service. I learned that I can use “InternalsVisibleTo†to enable such
access. Since I have control over both the class library project (with the
internal stuff) and the web project it seems that the scenario is possible.
However, the problem seems to be with the web service project being a web
project.
I followed all possible documentation and postings to create, sign and make
assemblies friendly. If I try to consume my class library (with internal
types) from a windows application (which was made trusted) everything works
perfectly as expected. If, however, I try to use it from within my web
project I get errors that the internal types and methods from the class
library are not visible:
Error 12 'EPHandl.Vault.PaymentVault' is inaccessible due to its protection
level c:\inetpub\wwwroot\epService\App_Code\CCProcessor.asmx.cs 111 13 http://localhost/epService/
Error 13 'EPHandl.Vault.PaymentVault' does not contain a definition for
'GetCreditCard' c:\inetpub\wwwroot\epService\App_Code\CCProcessor.asmx.cs 111 26 http://localhost/epService/
Here is how I indicated that I trusted the web project from the class
library project:
[assembly: InternalsVisibleTo("App_Code,
PublicKey=0024000004800000940000000602000000240000525341310004000001000100dd31afb809fb4cdaa134816a2dbadca223b0df0fffe8cf82842b5b848c2d51fb71a7f5b71273328d26d48faa8351e905105a5cb9b5103c442cbc20765e8404225b0ffac98dfe04de6536d5ccad16d3bb05791e9be1c8fedc65d3e77253aedff6f21d6d69dfb6cad9ffc4c4be8e752951ed6fd126f8c4df8c56457b2c38163ec4")]
I understand that the way web project is implemented in VS2005, it is not
fully compiled and signed until later point, so how can the
InternalsVisibleTo attribute be used to point to web projects’ assemblies?
There has got to be a way.
Thanks.
web service. I learned that I can use “InternalsVisibleTo†to enable such
access. Since I have control over both the class library project (with the
internal stuff) and the web project it seems that the scenario is possible.
However, the problem seems to be with the web service project being a web
project.
I followed all possible documentation and postings to create, sign and make
assemblies friendly. If I try to consume my class library (with internal
types) from a windows application (which was made trusted) everything works
perfectly as expected. If, however, I try to use it from within my web
project I get errors that the internal types and methods from the class
library are not visible:
Error 12 'EPHandl.Vault.PaymentVault' is inaccessible due to its protection
level c:\inetpub\wwwroot\epService\App_Code\CCProcessor.asmx.cs 111 13 http://localhost/epService/
Error 13 'EPHandl.Vault.PaymentVault' does not contain a definition for
'GetCreditCard' c:\inetpub\wwwroot\epService\App_Code\CCProcessor.asmx.cs 111 26 http://localhost/epService/
Here is how I indicated that I trusted the web project from the class
library project:
[assembly: InternalsVisibleTo("App_Code,
PublicKey=0024000004800000940000000602000000240000525341310004000001000100dd31afb809fb4cdaa134816a2dbadca223b0df0fffe8cf82842b5b848c2d51fb71a7f5b71273328d26d48faa8351e905105a5cb9b5103c442cbc20765e8404225b0ffac98dfe04de6536d5ccad16d3bb05791e9be1c8fedc65d3e77253aedff6f21d6d69dfb6cad9ffc4c4be8e752951ed6fd126f8c4df8c56457b2c38163ec4")]
I understand that the way web project is implemented in VS2005, it is not
fully compiled and signed until later point, so how can the
InternalsVisibleTo attribute be used to point to web projects’ assemblies?
There has got to be a way.
Thanks.