?
Solved

VB .NET 2003, Security Permissions Error

Posted on 2008-10-16
12
Medium Priority
?
287 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Are You Ready for GDPR?

With the GDPR deadline set for May 25, 2018, many organizations are ill-prepared due to uncertainty about the criteria for compliance. According to a recent WatchGuard survey, a staggering 37% of respondents don't even know if their organization needs to comply with GDPR. Do you?

 

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

Amazon Web Services EC2 Cheat Sheet

AWS EC2 is a core part of AWS’s cloud platform, allowing users to spin up virtual machines for a variety of tasks; however, EC2’s offerings can be overwhelming. Learn the basics with our new AWS cheat sheet – this time on EC2!

Question has a verified solution.

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

The recent Petya-like ransomware attack served a big blow to hundreds of banks, corporations and government offices The Acronis blog takes a closer look at this damaging worm to see what’s behind it – and offers up tips on how you can safeguard your…
I don't pretend to be an expert at this, but I have found a few things that are useful. I hope that sharing them here will help others, so they will not have to face some rather hard choices. Since I felt this to be a topic of enough importance and…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

719 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