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

Application does not start from network folder

Managed code .NET 3.5 C# WinForms application runs OK from Vista when in
local drive.

When application is copied to mapped network drive or started from
\\othercmp\c\myapp\myapp.exe folder , it does not start: Vista shows

MyApp has stopped working
Windows is checking for a solution to the problem..

How to fix ?
Andrus.

Jul 30 '08 #1
11 4367
If you are running a .exe over a network unc, then it won't trust it,
where-as local exes are given higher trust (full?).

Interestingly there is IIRC a change with SP1 which means that mapped
network drives execute with the higher trust. Other than that, there
are two options:

1: use "caspol" to set a higher trust against either the network share
or the application (perhaps using the strong-name as the key)
2: use ClickOnce deployment to the unc and execute the .application;
this includes trust information in the manifest

Marc
Jul 30 '08 #2
The following shows how to use caspol to trust a share:

http://msdn.microsoft.com/en-us/libr...t0(VS.80).aspx

But this needs to be done from each client. Conversely, ClickOnce will
work for any client that trusts the code-signing certificate.

Marc
Jul 30 '08 #3
Marc,
But this needs to be done from each client. Conversely, ClickOnce will
work for any client that trusts the code-signing certificate.
This requires making changes in every client computer every time when new
version of unsigned application is copied to new network share.

I need that in MDI child form Escape key closes form, Ctrl+F1 cycles and
Ctrl+F10 toggles maximizing. For this I use code below in form base class
which requires full trust.
How to implement those features without full trust ?

Andrus.
[SecurityPermission(SecurityAction.LinkDemand, Flags =
SecurityPermissionFlag.UnmanagedCode)]
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch (keyData)
{
case Keys.Escape:
if (this != FormManager.MainForm)
{
Close();
return true;
}
break;

case Keys.Control | Keys.F1:
for (int i = 0; i <
FormManager.MainForm.MdiChildren.Length; i++)
{
if (FormManager.MainForm.MdiChildren[i] == this)
{

if (i <
FormManager.MainForm.MdiChildren.Length - 1)
FormManager.MainForm.MdiChildren[i +
1].Focus();
else
FormManager.MainForm.MdiChildren[0].Focus();

return true;
}
}
return true;

case Keys.Control | Keys.F10:
if (WindowState == FormWindowState.Maximized)
WindowState = FormWindowState.Normal;
else
WindowState = FormWindowState.Maximized;
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
}

Jul 30 '08 #4
Marc,
The following shows how to use caspol to trust a share:

http://msdn.microsoft.com/en-us/libr...t0(VS.80).aspx

But this needs to be done from each client. Conversely, ClickOnce will
work for any client that trusts the code-signing certificate.
This article also recommends to use

Control Panel
Administrative Tools
Microsoft .NET Framework 3.5 Configuration

However in my Vista there is no such option in "Administrative Tools".

Andrus.
Jul 30 '08 #5
The following shows how to use caspol to trust a share:
>
http://msdn.microsoft.com/en-us/libr...t0(VS.80).aspx

But this needs to be done from each client. Conversely, ClickOnce will
work for any client that trusts the code-signing certificate.
I run with adminstrator rights in Vista

C:\...crosoft.NET\Framework\v2.0.50727>g 1.2 -url file://z:/myapp/*
FullTrust
Microsoft (R) .NET Framework CasPol 2.0.50727.1434
Copyright (c) Microsoft Corporation. All rights reserved.

The operation you are performing will alter security policy.
Are you sure you want to perform this operation? (yes/no)
y
Added union code group with "-url" membership condition to the Machine
level.
Success
However

z:\myapp\myapp.exe

still shows immediately

Myapp as stopped working

Andrus.

Jul 30 '08 #6
This requires making changes in every client computer every time when new
version of unsigned application is copied to new network share.
No, it really doesn't. ClickOnce is designed to handle such scenarios.
No additional client updates will be needed. If you already have a
code-signing certificate that is trusted, or purchase a "pucka" code-
signing certificate, then no changes are required even on vanilla
desktops (with the runtime installed).

Marc
Jul 30 '08 #7
Microsoft .NET Framework 3.5 Configuration

There is an mmc snap-in, but unlike 1.1 it is not part of a standard
install; it requires one of the SDKs to be installed. I have no idea
once, since I haven't used this tool since ClickOnce was released with
2.0 / VS2005. However, caspol.exe *is* part of the core framework
install, hence why I advised to use caspol.exe to deploy any such
changes.

Note that the UI tool, last time I used it, allowed you to export an
msi for installing at clients, but it seemed to overwrite (rather than
extend) the client's settings; so even "back in the day" I used to use
caspol.exe for deployment changes.

Marc
Jul 30 '08 #8
On Jul 30, 4:10*am, "Andrus" <kobrule...@hot.eewrote:
Managed code .NET 3.5 C# WinForms application runs OK from Vista when in
local drive.

When application is copied to mapped network drive or started from
\\othercmp\c\myapp\myapp.exe folder , it does not start: Vista shows

MyApp *has stopped working
Windows is checking for a solution to the problem..

How to fix ?

Andrus.
There is an one-click solution (well almost one click -- you have to
run it on each target workstation) it is designed for the .NET 2.0.
so I'm not sure it will for your app, but might be worth a shot, or
at least point you in the right direction:
http://www.jjclements.co.uk/index.ph...network-share/

David
Jul 30 '08 #9
>This requires making changes in every client computer every time when new
>version of unsigned application is copied to new network share.

No, it really doesn't. ClickOnce is designed to handle such scenarios.
No additional client updates will be needed. If you already have a
code-signing certificate that is trusted, or purchase a "pucka" code-
signing certificate, then no changes are required even on vanilla
desktops (with the runtime installed).
Marc,

my application generates dynamic assembly and creates temporary assemblies
from scripts. I do'nt know how to sign those assemblies.

So it seems that I cannot use signed assemblies since as I know signed
assembly requires that all assemblies it calls must be also signed.

Is it possible to use ClickOnce with unsigned assemblies?

Andrus.

Jul 30 '08 #10
However, caspol.exe *is* part of the core framework
install, hence why I advised to use caspol.exe to deploy any such
changes.
I tried caspol as described in other message but application still causes
unmanaged exception, without net error handling window.

I expect that missing permission should cause .NET unhandled exception
dialog, not

Vista stupid "Application stops responding" window without stack trace.

Andrus.

Jul 30 '08 #11
David,
>There is an one-click solution (well almost one click -- you have to
run it on each target workstation) it is designed for the .NET 2.0.
so I'm not sure it will for your app, but might be worth a shot, or
at least point you in the right direction:
http://www.jjclements.co.uk/index.ph...network-share/
I installed the file

http://www.jjclements.co.uk/wp-conte...for-net-20.zip

in Vista SP1 but my application still causes "Myapp has stopped working"
window when running from XP SP3 LAN network folder. My application contains
managed code only.
I tried to run it with "Run as Administrator" but problem persists.
If i copy this folder to my Vista C: drive, it runs OK.

Andrus.

Jul 30 '08 #12

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

Similar topics

8
by: Pete Wittig | last post by:
Hello, I am wondering if it is possible to create a networked application with C# that is seen as a windows user. For example, if Bob logged onto windows and then started the application, any...
5
by: Martin Robins | last post by:
I have never dabbled with ASP.NET until now so be warned! I have created a web application with the single default form: WebForm1.aspx and when I try to display it I get this error. My...
5
by: Jim Heavey | last post by:
Hello, I am trying to figure out how to put my application onto the server. I am deploying to a Windows 2000 Server When I bring up Internet Services Manager and navigate to the Default Web...
2
by: salad | last post by:
Hi. I have some questions regarding the distribution and installation of an application. My current application is written in A97. I figure its time the application is upgraded to A2003 to...
2
by: Keld R. Hansen | last post by:
I am coding a .NET 2.0 application that needs to be able to run from a network share (intranet), but the security settings does not allow me to do this by default. How can I - in the...
2
by: Bill Fallon | last post by:
I have a VS2005 VB.Net windows form application deployed to a share drive. The windows explorer security permissions for this application (.exe) file is set for Everyone with List Folder/Read Data...
7
by: Speech Lover | last post by:
I have problem writing content to a UNC file from my ASP.NET 1.1 application. This is on Windows server 2003 The event log says "X:\temp\abc.txt path not found" and stuff. Note that I have...
4
by: =?Utf-8?B?VkIgSm9ubmll?= | last post by:
I am at my witless end here, please help! I have an ASP.Net aspx web page, hosted on Windows Server 2003, that receives a query string with the path to an autocad drawing file selected from a...
1
by: Bhrionn | last post by:
Hello World, I am working on implementing a build for my companies application. The scenario implemeted is producing the error: ‘Class does not support automation or does not support expected...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.