473,394 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Web Application, Web Service, Class Libraries, and StrongNameIdentityPermissionAttribute Class

I have the following setup:

BLL Project
Category.vb
AssemblyInfo.vb

Schema Project
Category.xsd
AssemblyInfo.vb

Web Service Project
CategoryService.asmx
AssemblyInfo.vb

Web Application Project
WebServiceTest.aspx
AssemblyInfo.vb
In the BLL project's AssemblyInfo, I have the following:

<Assembly: AssemblyKeyName("...")>

and in it's Category.vb class:

< _
Transaction(TransactionOption.Required), _
StrongNameIdentityPermission( _
SecurityAction.Demand, _
PublicKey := "..." _
) _
_

Public Class Category
...
In my Web Service and Web Application projects, I have the following in
AssemblyInfo.vb files:

<Assembly: AssemblyKeyName("...")>

The key name matches the same key name in the BLL project's AssemblyInfo.vb
file. I have installed the strong-name key into the CSP and get the public
key from the dll using secutil -hex -s myassembly.dll which I place into the
StrongNameIdentityPermission attributes constructor for the Category Class
definition.

Anywho, the problem is, when I build and then run the application, I get the
following:
Server was unable to process request. --> Request for the permission of type
System.Security.Permissions.StrongNameIdentityPerm ission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=... failed.

Anyone have any idea how to get the StrongNameIdentityPermissionAttribute
class to work correctly? I do not want SecurityAction.LinkDemand, just
SecurityAction.Demand.

Thanks,
Mythran

Nov 19 '05 #1
1 1540

"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:OJ**************@tk2msftngp13.phx.gbl...
I have the following setup:

BLL Project
Category.vb
AssemblyInfo.vb

Schema Project
Category.xsd
AssemblyInfo.vb

Web Service Project
CategoryService.asmx
AssemblyInfo.vb

Web Application Project
WebServiceTest.aspx
AssemblyInfo.vb
In the BLL project's AssemblyInfo, I have the following:

<Assembly: AssemblyKeyName("...")>

and in it's Category.vb class:

< _
Transaction(TransactionOption.Required), _
StrongNameIdentityPermission( _
SecurityAction.Demand, _
PublicKey := "..." _
) _
_

Public Class Category
...
In my Web Service and Web Application projects, I have the following in
AssemblyInfo.vb files:

<Assembly: AssemblyKeyName("...")>

The key name matches the same key name in the BLL project's
AssemblyInfo.vb file. I have installed the strong-name key into the CSP
and get the public key from the dll using secutil -hex -s myassembly.dll
which I place into the StrongNameIdentityPermission attributes constructor
for the Category Class definition.

Anywho, the problem is, when I build and then run the application, I get
the following:
Server was unable to process request. --> Request for the permission of
type System.Security.Permissions.StrongNameIdentityPerm ission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=... failed.

Anyone have any idea how to get the StrongNameIdentityPermissionAttribute
class to work correctly? I do not want SecurityAction.LinkDemand, just
SecurityAction.Demand.

Thanks,
Mythran


Gah! Just found:

Note: Issuing a full stack walk demand for the
StrongNameIdentityPermission does not work if your assembly is called by a
Web application or Web service. This is because it is not possible to strong
name the dynamically compiled classes associated with ASP.NET Web
applications or Web services.

That stinks...so SecurityAction.Demand won't work on
StrongNameIdentityPermissionAttribute :( So, guess I have to use LinkDemand
:(

Mythran

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Cablito | last post by:
Is there a way to protect my class libraries? I have for instance, a class library full of my base forms and classes latter inherited by various projects. A lot of logic is within those...
10
by: Jeremy Ames | last post by:
I have created a web application that uses a custom control and a web service on my local system. I have gotten all of the bugs worked out on my local system and now it is time to move it to the...
5
by: z. f. | last post by:
Hi, I'm working on a web project and i create classes to do business logic and connect to DB. i also need a windows application to do the same functionality as defined in classes inside the...
1
by: Nelson | last post by:
Hi Folks, How can I secure an Assembly (DLL) from being referenced in programs other than my Strong Named Assembly (EXE) by using the StrongNameIdentityPermissionAttribute. Nelson
4
by: Chris Curvey | last post by:
Hi all, I have used the win32com libraries to set up a service called MyService under Windows. So far, so good. Now I need to run multiple copies of the service on the same machine. I also...
0
by: Ludwig | last post by:
Hi, I'm about to start development of a SOA type application using C# and Visual Studio team System. Description: A Business layer contains a web service that uses a Business Component; this...
4
by: | last post by:
I have learned about compartmentalizing my code base using Class Libraries. I have my common code such as my ORM framework broken out into their own Class Libraries, which are referenced as...
4
by: Coder | last post by:
Hello, Can my application call a web service ? and web service returns a class file ? Then May I run this "cs" file in my main application ? without compiling ? Thanks Coder @Toronto
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.