Solved

VB .NET 2003, Security Permissions Error

Posted on 2008-10-16
12
272 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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
 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Winform Module - What is the ASP.Net equiv 2 23
Upgrade BIOS / EUFI at Scale 4 40
How to limit User Input 2 21
exchange, activesync 2 15
Pop culture is prime bait for hackers seeking to infect user’s computers and mobile devices with malicious malware. Hackers know exactly what the latest trends are online and know how to use them to their advantage.
Data breaches are on the rise, and companies are preparing by boosting their cybersecurity budgets. According to the Cybersecurity Market Report (http://www.cybersecurityventures.com/cybersecurity-market-report), worldwide spending on cybersecurity …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

825 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