473,545 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

about deploying

Hello!

I have a simple application from a book where the actual applications
permission doesn't match the permission referenced from the book.
My question is written further down.
The book is saying the following : "The calculate permission button from the
security properties of Visual Studio analysis is
an application manifest that includes all required permissions. With Visual
Studio 2005, you can see the
application manifest with the name app.manifest below Properties in the
Solution Explorer. The content of this file is shown
here. The XML element <applicationReq uestMinimumdefi nes all required
permissions of the application.
The FileIOPermissio n is required because the application reads and writes
files using classes from System.IO namaspace."

Below is a copy of app.manifest.
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assemb ly manifestVersion ="1.0"
xmlns="urn:sche mas-microsoft-com:asm.v1"
xmlns:asmv1="ur n:schemas-microsoft-com:asm.v1"
xmlns:asmv2="ur n:schemas-microsoft-com:asm.v2"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<trustInfo xmlns="urn:sche mas-microsoft-com:asm.v2">
<security>
<applicationReq uestMinimum>
<defaultAssembl yRequest permissionSetRe ference="Custom " />
<PermissionSe t class="System.S ecurity.Permiss ionSet" version="1"
ID="Custom" SameSite="site" >
<IPermission
class="System.S ecurity.Permiss ions.Reflection Permission, mscorlib,
Version=2.0.0.0 , Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1" Unrestricted="t rue" />
<IPermission
class="System.S ecurity.Permiss ions.SecurityPe rmission, mscorlib,
Version=2.0.0.0 , Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1" Flags="Unmanage dCode, Execution, ControlEvidence " />
<IPermission class="System.S ecurity.Permiss ions.UIPermissi on,
mscorlib, Version=2.0.0.0 , Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1" Unrestricted="t rue" />
<IPermission
class="System.S ecurity.Permiss ions.KeyContain erPermission, mscorlib,
Version=2.0.0.0 , Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
version="1" Unrestricted="t rue" />
</PermissionSet>
</applicationRequ estMinimum>
</security>
</trustInfo>
</asmv1:assembly>
Below is the main class and as you can see I use file IO operation so the
application needs the FileIOPermissio n.
Now to my question: When I click on the "calculate Permission" button in the
sequrity after choosing the property for the
project the FileIOPermissio n is not selected as a requirement for the
application but according to the book the appliaction
needs this requirement and I must agree with the book in this case.

Can anyone explain the reason why the sequrity button named calculate
permission doesn't include FileIOPermissio n for
the application as a permission requirement ?

using System;
using System.Collecti ons.Generic;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.IO;
using System.Windows. Forms;
using System.Drawing. Printing;

namespace SimpleEditor
{
public partial class SimpleEditorFor m : Form
{
private string filename = "Untitled";
private string[] lines;
private int linesPrinted;
private Brush printBrush;

public SimpleEditorFor m() //User defined C-tor
{ InitializeCompo nent(); }

protected void OpenFile()
{
try
{
textBoxEdit.Cle ar();
textBoxEdit.Tex t = File.ReadAllTex t(filename);
}
catch(IOExcepti on ex)
{
MessageBox.Show (ex.Message, "Simple Editor",
MessageBoxButto ns.OK, MessageBoxIcon. Exclamation);
}
}

private void OnFileNew(objec t sender, EventArgs e)
{
filename = "Untitled";
SetFormTitle();
textBoxEdit.Cle ar(); // clear textbox
}

private void OnFileOpen(obje ct sender, EventArgs e)
{
if (dlgOpenFile.Sh owDialog() == DialogResult.OK )
{
filename = dlgOpenFile.Fil eName;
SetFormTitle();
OpenFile();
}
}

private void OnFileSave(obje ct sender, EventArgs e)
{
if (filename == "Untitled")
OnFileSaveAs(se nder, e);
else
SaveFile();

}

private void OnFileSaveAs(ob ject sender, EventArgs e)
{
if (dlgSaveFile.Sh owDialog() == DialogResult.OK )
{
filename = dlgSaveFile.Fil eName;
SetFormTitle();
SaveFile();
}
}

private void SaveFile()
{
try
{
File.WriteAllTe xt(filename, this.textBoxEdi t.Text);
}
catch(IOExcepti on ex)
{
MessageBox.Show (ex.Message, "Simple Editor",
MessageBoxButto ns.AbortRetryIg nore,MessageBox Icon.Hand);
}
}

protected void SetFormTitle()
{
Text = new FileInfo(filena me).Name + "- Simple Editor";
}

private void OnFilePrint(obj ect sender, EventArgs e)
{
if (this.textBoxEd it.SelectedText != "")
dlgPrint.AllowS election = true;

if (dlgPrint.ShowD ialog() == DialogResult.OK )
printDocument.P rint();
}

private void OnFilePrintPrev iew(object sender, EventArgs e)
{ dlgPrintPreview .ShowDialog(); }

private void OnFilePageSetup (object sender, EventArgs e)
{ dlgPageSetup.Sh owDialog(); }

private void OnExit(object sender, EventArgs e)
{ Application.Exi t(); }

private void OnPrintPage(obj ect sender, PrintPageEventA rgs e)
{
int x = e.MarginBounds. Left;
int y = e.MarginBounds. Top;

while (linesPrinted < lines.Length) //antal rader att printa
{
e.Graphics.Draw String(lines[linesPrinted++],
this.fontDialog .Font, printBrush, x, y);
y += textBoxEdit.Fon t.Height;

if (y >= e.MarginBounds. Bottom)
{
e.HasMorePages = true;
return;
}
}
}

private void OnBeginPrint(ob ject sender, PrintEventArgs e)
{
char[] param = { '\n' };

if (dlgPrint.Print erSettings.Prin tRange == PrintRange.Sele ction)
lines = textBoxEdit.Sel ectedText.Split (param);
else
lines = textBoxEdit.Tex t.Split(param);

//int i = 0;
//char[] trimParam = { '\r' };

//foreach (string s in lines)
// lines[i++] = s.TrimEnd(trimP aram);
if (this.dlgPrint. PrinterSettings .SupportsColor)
printBrush = new SolidBrush(text BoxEdit.ForeCol or);
else
printBrush = Brushes.Black;
}

private void OnEndPrint(obje ct sender, PrintEventArgs e)
{ lines = null; }
private void fontToolStripMe nuItem_Click(ob ject sender, EventArgs e)
{
if (fontDialog.Sho wDialog() == DialogResult.OK )
textBoxEdit.Fon t = fontDialog.Font ;
}

private void colorToolStripM enuItem_Click(o bject sender, EventArgs
e)
{
if (colorDialog.Sh owDialog() == DialogResult.OK )
textBoxEdit.For eColor = colorDialog.Col or;
}
}
}

//Tony
Jul 21 '08 #1
0 1158

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

Similar topics

0
1591
by: Sean Campbell | last post by:
Hi, My group have a ASP.NET based application ( currently running on 1.0.3705 ). Ideally, we would like to deploy new components(asp files/assemblies/db updates) into a live environment without interuption. However, it appears that upon deploying new assemblies to \appbase\bin we immediately get 'Access is denied: xxx.dll' exceptions...
1
1772
by: Terry H | last post by:
Hi I am deploying a winforms app via the windows installer and a VS.Net 2003 setup and deploymnet project. At the moment, I am adding launch conditions for the .Net Framework 1.1 and MDAC 2.7 or higher, and am prompting the user to run the relevant setup files if they're missing. I'm including these setup files on the CD. I can't work...
1
1732
by: dansan | last post by:
We have a webservice that we have been deploying using the deployment project in Visual Studio. Now we are trying to deploy this service to a server that has multiple sites. I have looked everywhere in the deployement project to see where I can allow the person installing to choose the root, but I can't find anything. Is there a way to...
2
1331
by: Flip | last post by:
I am deploying webapps using XP (IIS5) and deploying them to a Windows 2003 Server box (IIS6). So far so good. However, when I try to manage my w2k3 server from XP, I get an error message saying I can't manage an IIS6 box from IIS5. Is anyone else seeing this? Can I take my w2k3 server CDs and install IIS6 on my XP box? Do I have to...
3
1881
by: Rachel | last post by:
Hi, I am using the data access application block successfully in our development environment, however when I deploy to our testing server as Private Assemblies I keep getting the following Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the...
4
1632
by: john | last post by:
I think some of the changes to Asp.net are rediculous. Take the ability to deploy source code to production that is compiled on the fly. If this is such a great model, why not distribute your source code with your Windows Forms apps too? John Powell
1
1753
by: Jeff | last post by:
Hey I've installed DotNetNuke Starter Kit (4.3.4) together with visual web developer 2005 express on my development computer So now I'm able to create DotNetNuke portals using vwd. But this is as I mention on my development computer with vwd. But what if I have a client which have asked me to create a DotNetNuke site for them. They of...
6
1106
by: milind | last post by:
tell more about .net framework EggHeadCafe.com - .NET Developer Portal of Choice http://www.eggheadcafe.com
1
933
by: =?Utf-8?B?d2lsbGlhbQ==?= | last post by:
Hi All, I've seen a lot of articles which show you how to deploy asp.net web application and web service, but all of them deploy application/web service under default folder virtual directory. But I think it make more sense that deploying diffenrent application/web service as separate web site, so that it's easy for us to maintain later on....
5
1355
by: RobinS | last post by:
My company is considering moving up from .Net 2.0 to .Net 3.5(SP1) as a prerequisite on the ClickOnce deployment for our application. Does anybody have any experience deploying .Net 3.5 either as a prerequisite, or just by itself? Have you had any problems installing it? One issue I've seen reported is when pushed as a prerequisite, it...
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7756
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5326
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1879
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
703
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.