473,382 Members | 1,750 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,382 software developers and data experts.

Running a local exe as Partially trusted.

Is there an easy way for me to add something in my source code to give my
code only partially trusted access so I can debug it?

Thanks.

Scott
Nov 20 '05 #1
1 1374
You can try to write another small app to load your original application in
a domain.

The code of that app looks like:

Imports System.Security
Imports System.Security.Permissions
Imports System.Security.Policy

Sub Main(ByVal CmdArgs() As String)
If CmdArgs.Length <> 2 Then Return
Dim AppPath As String = CmdArgs(0)
Dim CodeBase As String = CmdArgs(1)

Dim e As New Evidence()
e.AddHost(New Url(CodeBase))
e.AddHost(Zone.CreateFromUrl(CodeBase))
e.AddHost(Site.CreateFromUrl(CodeBase))

Dim ad As AppDomain = AppDomain.CreateDomain("TestHost")
ad.ExecuteAssembly(AppPath, e)
AppDomain.Unload(ad)
End Sub

==

Lifeng
MS VB

Nov 20 '05 #2

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

Similar topics

7
by: Marek | last post by:
Whe i'm running my .net aplication from share on other server, i've got an error. Can someone explain what i must do? Unhandle exception:System.Security.SecurityException: Permission demand type...
1
by: Parveen | last post by:
When I try to deploy my windows application, the installer puts the program executable on the user's local machine...I would rather have the executable run from a folder on the network...this way it...
0
by: RKris | last post by:
Hi, I am writing an ADO.Net application that connects to a remote database. When I run the application I am getting a security exception saying this application is partially trusted and the...
4
by: =?Utf-8?B?bWFyY21j?= | last post by:
Hi, I've just deployed my application which I ported from VS.Net 2003 to VS.Net 2005 and also from SQLServer to Teradata. When I put the executable on the network it won't run. The error is...
2
by: Vandana T | last post by:
I created a console application to read and manipulate an Excel file. I added reference to the Microsoft Excel 11.0 Object Library. When I place it in Network Drive and try to run the .exe from my...
1
by: Matt Culbreth | last post by:
Hello All, I've got a very simple ASP.NET 2.0 application which uses a DLL from a third party. I don't have the source to this DLL. Everything has been working fine on my XP development...
5
by: =?Utf-8?B?TWFydHluIEZld3RyZWxs?= | last post by:
From the amount of articles about this one I’m sure this gets asked a lot, but I haven’t yet found a succinct article which explains what is required in its entirety. I work using Visual...
0
by: =?Utf-8?B?Sm9iIExvdA==?= | last post by:
I have created Exception Handling Policy that shows a custom error message using Custom Handler and logs it to event log using Logging Handler. I am using this policy in various layers of my...
1
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.