Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB .NET 2003, Security Permissions Error

Posted on 2008-10-16
12
Medium Priority
?
290 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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 

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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Ransomware - Defeated! Client opened the wrong email and was attacked by Ransomware. I was able to use file recovery utilities to find shadow copies of the encrypted files and make a complete recovery.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
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…

916 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