Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my Code , i publish my Windows Application Form with ClickOnce ,
There is a button in form it is supposed to start an installation of the Screen Share software when it is clicked.
Here is my Publish Folder Path : \\192.168.0.1\PUBLiC\Akmal\ProcessEndLastFTP\
Here is my Installation URL : \\192.168.0.1\PUBLiC\Akmal\ProcessEndLastFTP\
File is placed on UNC Path ,
PROBLEM
When i publish it , it starts the installation of windows form. But when i click the Button it shows an exception
System.ComponentModel.Win32Exception The network name cannot be fount etc....
NOTE
It invoke the installation behind button in windows XP but shows Exception in WIndows 7
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace ApplicationShield
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Process p = new Process();
            try
            {      
                p.StartInfo.UseShellExecute = false;
                p.StartInfo.FileName = @"\\192.168.0.1\public\Akmal\IBTalk_Screenshare.exe";
                p.Start();            
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                MessageBox.Show("Installation Canceled");
            }
        }
    }
}
Posted
Updated 25-Jun-13 1:19am
v2
Comments
Mike Meinz 25-Jun-13 7:36am    
Is it possible that the WIndows 7 computer does not have permission to view the file share or that there is some other security issue blocking access to the file share?

Is \\192.168.0.1\public\Akmal\IBTalk_Screenshare.exe to be deployed via Click Once or is the source code provided in your question the software that is deployed via Click Once?

What happens if you execute \\192.168.0.1\public\Akmal\IBTalk_Screenshare.exe on the Windows 7 PC by typing it into a CMD Window?

What happens if you type net view \\192.168.0.1 into a CMD Window on the Windows 7 PC?
BulletVictim 26-Jun-13 2:55am    
I know its basics, but it has worked sometimes for me.
Try switching to '/' instead of '\' so your location would be something like this @"\\192.168.0.1/public/Akmal/IBTalk_Screenshare.exe".

Just a thought
Akmal Abbas Naqvi 28-Jun-13 3:24am    
Thankyou everyone !
I solved the problem ,
and i really appreciate your helping nature ....
Akmal Abbas Naqvi 28-Jun-13 3:25am    
All it needs to add an app.manifest file and change the requestExecution level to asInvoker
and use that app.manifest as the manifest of the project
cheers !!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900