Solved

VB .NET 2003, Security Permissions Error

Posted on 2008-10-16
12
263 Views
Last Modified: 2008-10-22
I have an application that was written in VB .NET 2003 using Framework 1.1. What would cause this error to occur on a user PC but not a developer machine?

Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.0500.0, Culture=neutral, PublicKeyToken=b77a5c564934e089 failed.

It was working before, but our company does nightly updates to our PCs (we lock them but never shut them off).  I checked the Trust Levels in Administrative Tools-->Microsoft .NET Framework 1.1 Wizards and they are set to full.  The Assembly is pointing to the correct application.  The ODBCs are setup for the application to connect to the database via Windows Authentication.  I'm at a loss for what could cause this error to appear when one day the program works then it's broken the next.

Thanks in advance for any help!
0
Comment
Question by:nightshadz
  • 6
  • 6
12 Comments
 
LVL 11

Expert Comment

by:melmers
ID: 22737935
Are the App running from a network share ?
Have you Global Security Policies in your Domain which overwrites the .NET Configuration ?
0
 

Author Comment

by:nightshadz
ID: 22740561
Yes, the app is running from a network share.  Basically the users have a shortcut on their desktops to the app on the server.

The error occurs after a button click which creates two Excel (XLS) files.  I don't have any control over domain policies.  That's a different group within the company.  

1) If the answer lies in Global Security Policies in the domain, what should I ask that group?
2) Now that you know it's running from a network share, is there anything on my end I can do to prevent this error?

Thanks!
0
 
LVL 11

Expert Comment

by:melmers
ID: 22740611
The application starts without the error ? then it's not the security policy becaus it would prevent the startup of the app.

your excel creation does you have different excel versions running (2007 and 2003)
0
 

Author Comment

by:nightshadz
ID: 22740767
Yes, every part of the application runs fine except for when the user clicks on the button to create the Excel files.  By different versions of excel do you mean does the user have different versions of MS Office installed on their PC?  The only version of Office this company uses now is 2003.

The procedure starts like this after the button is clicked:
        Dim xlsMain As New Excel.Application
        Dim xlWrkBk As Excel.Workbook

        Dim ds As DataSet
        Dim ds1 As DataSet

        If xlsMain Is Nothing Then
            MsgBox("Could not start Excel!", vbCritical + vbOKOnly, "FAS 109 Load Error")
            Exit Sub
        End If

        Try
           .........
0
 
LVL 11

Expert Comment

by:melmers
ID: 22741691
Is Office installed on the Machine where the application runs ?
Does this error occur on all machines or only on some ?

Try to change the line
Dim xlsMain as Object = CreateObject("Microsoft.Excel")
0
 

Author Comment

by:nightshadz
ID: 22741877
It only happens on one user's machine.  It runs fine on others.  

What about the workbook variable xlWrkBk.  What parameter would I pass to CreateObject for that?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:nightshadz
ID: 22742066
Dim xlsMain as Object = CreateObject("Microsoft.Excel") caused the program to crash - "Cannot create ActiveX component.".  Any idea why this would happen?
0
 
LVL 11

Expert Comment

by:melmers
ID: 22742989
Sorry wrong Progid.
Dim xlsMain as Object = CreateObject("Excel.Application")
0
 

Author Comment

by:nightshadz
ID: 22744340
I still get the Security Permissions error.
0
 
LVL 11

Expert Comment

by:melmers
ID: 22744772
when you copy the executables and the interop assemblies to a local folder does it run on the clients?
0
 

Author Comment

by:nightshadz
ID: 22761503
This worked, but it can't be the solution as every user has a link on their desktop to run the application.  If the interop files were on the server with the app, will it work then?

What caused it to work when the executable and the interop files were in the same folder locally?
0
 
LVL 11

Accepted Solution

by:
melmers earned 500 total points
ID: 22761579
i think that are group policies or lost "full trust" to the network share. are there any domain policies that reset the trusts from the .net config ?

if it runs localy then it is a wrong trust or lost trust to your network share.
speak with your domain admins to set your share into a full trust share.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
By this time the large percentage of day-to-day transactions have shifted to mobile banking; here are some overriding areas QAs must investigate while testing mobile banking apps.  
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now