|
You either have to copy it to the other machines that are going to use it or copy it to a share on a server. But, in the later case, you MUST be aware of Code Access Security and how it affects your code. Code running from ANY network resource, trusted or otherwise, is NOT trusted code as far as the local machine is concerned. Your application will be running, by default, in a heavily restricted sandbox. What works fine is launched from on the local machine can quite easily fail if run from a server because of CAS. You can read about it here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Dave Kreskowiak,]
Thank u very much for ur reply .
I have tried wat u said.
I have many forms in my apllication.The first form is working fine which is the Login form .But when i click login button its not getting redirected to the next form .
Iam using a third party control in the second form..
Iam getting the error as
Unhandled exception has occured in your application.An error occured creating the form.See Exception.Innerexception for details.The error is:That assembly does not allow partially trusted callers.
Awaiting for your Reply
Regards
Bino Varghese.V
|
|
|
|
|
Read up on Code Access Security. There's a link in my previous post.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
ok give me some time will read and reply u
Thank u very much 4 ur guidence n speedy reply..
Regards
Bino Varghese.V
|
|
|
|
|
Here's a small thought, perphaps it can be of use.
Try making (instead of a shortcut) an actual application that
when run, locates the exe in question from the server, and copies it over and then executes it
locally.
I do that with some simple programs, and i also add a simple "version" check to see if the
exe is newer than the one on the local machine. (by checking creation date of the exe)
the program could have something like:
<br />
Public Class Form1<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
Dim remoteEXE As String = "\\server\C\Folder\myExe.exe"<br />
Dim localEXE As String = "C:\Folder\MyExe.exe"<br />
<br />
If My.Computer.FileSystem.FileExists(remoteEXE) Then<br />
If My.Computer.FileSystem.FileExists(localEXE) Then<br />
If My.Computer.FileSystem.GetFileInfo(remoteEXE).CreationTime > My.Computer.FileSystem.GetFileInfo(localEXE).CreationTime Then<br />
My.Computer.FileSystem.CopyFile(remoteEXE, localEXE, True)<br />
End If<br />
Else<br />
My.Computer.FileSystem.CopyFile(remoteEXE, localEXE)<br />
End If<br />
End If<br />
<br />
Shell(localEXE, AppWinStyle.NormalFocus)<br />
End Sub<br />
<br />
End Class<br />
<br />
|
|
|
|
|
Hi ad3z ,
Happy New year.Thanks 4 ur reply ..vl check this one.
my actual problem is with security issues can u plz gudie me in that..
Regards
Bino Varghese.V
|
|
|
|
|
The only security my simple solution could offer is the security defined by your domain (i.e. Active Directory and policies in a windows environment)
|
|
|
|
|
Hi
Didnt get u ..Me a beginner in Vb.net so plz explain me wat it is..
Then i tried the code which u gave me ..i think it will work ,but the problem is the new exe is not getting copied..but if i try this code using some notepad files it is working fine.Can u plz give me some details how to do plz..I need this very badly..
Awaiting eagerly For your reply,,
Bino Varghese
|
|
|
|
|
Well instead of the shell function, try using the Process.Start function
i.e. Process.Start(localEXE)
|
|
|
|
|
the problem is I cant copy the new exe file 4m the server.Shell coding is working properly but the old Exe is getting displayed...
so if u can tell me how to copy exe file 4m a 2003 server it vl be helpfull for me
Awaiting 4 ur reply
\Bino varghese
|
|
|
|
|
1) do you have the right permissions set up on your network ?
i.e. can the host manually copy paste the file in question?
2) are you connecting to the server correctly ?
if you type in \\putservernamehere\someshare\somefolder does it connect directly?
this solution is an anorthodox solution, and it works for me in a well set up domain
where each host has appropriate access to the server
otherwise this should be done properly, by configuring the right CAS permissions to
execute the file(s).
i can't help you much more as i don't know how your network is configured
|
|
|
|
|
Hi ad3z,
Thank u very much man for this type of explanation.you should be a Patient man i guess .
Yes i have checked ur two points , now I have given Full rights in the server.The code is working fine my friend.Thank u very much man..
I have a doubt now.
In the Newer Version of the Exe.i have added some new components that additional features is not working. But I can assure u that only the new version of EXEs is working ..
Can u guide me in this issue too..
Thanking u again!!
Bye
Regards
Bino Varghese.V
|
|
|
|
|
BINO VARGHESE wrote: In the Newer Version of the Exe.i have added some new components that additional features is not working. But I can assure u that only the new version of EXEs is working ..
Can u guide me in this issue too..
Adding components (such as DLL files) to your project means that you are accessing resources that will not be compiled in your program.
In other words you need to copy more than just the exe. Notice that if you publish your application, and view the prerequisites, you'll notice that with the built exe all the additional components will be added.
In a simple application (that will not scale much further) you should copy all the files found under your compilation directory.
(All the files in the debug or bin directory should be together with the exe file)
Most likely it's the case of that "new" dll you added.
Ericos Georgiades
|
|
|
|
|
Hi Ericos Georgiades,
u r cen % rite.yes i have dll file and i have also used a Excel component for reporting purpose in this version.
Now how do i add this ??
Bino Varghese.V
|
|
|
|
|
if it works on the machine you have developed this
then have a look at the debug (or bin) directory of your project
there you'll see all the files that the exe is directly using (assuming that the dll is copied to the output directory)
copy all the files to the host, not just the new exe.
otherwise you should publish and install your solution at least once on the host,
and then all you'll need to replace is the exe.
hope it helps
Ericos Georgiades
|
|
|
|
|
Thanx Ericos, i have done this and compiled my project using setup project wizard..
Now my doubt is how to copy the new dlls alone to the client machine so that i need not run the setup again..
Bino Varghese.V
|
|
|
|
|
The same way you did with the exe.
I'll leave this one up to you
Ericos Georgiades
|
|
|
|
|
okai ..let me try and get back to u ..
Thanks again...
|
|
|
|
|
Hi,
I know there is probably a simple answer to this.
I've created a deployment project and I cannot get the Readme.rtf file to display. I added it to the APPLICATION FOLDER, then to the USER INTERFACE with the "readmefile" property set to the file. When I run the install nothing shows. Anyone have any ideas?
Thanks
zxcvbnm
|
|
|
|
|
Hi,
I see that I'm not the only one facing that problem, at first i thought it was a bug, until, I came across a few other guys facing the same issue. I'm also looking for a work around to this problem, and would be glad if someone knew what the problem is
|
|
|
|
|
Hi! everybody.
How can I get the name of SQL Servers on my network. When I load main form, I want to get SQL servers name into combobox and the user can choose which server they want to use. Could you help me please.
Thanks in advance.
|
|
|
|
|
Ok, you can set a bitmap transparency by saying something along these lines:
Bitmap.MakeTransparent(Color)
but after you have done this, is there a way to either
1.) retrieve this color so you know what the transparent color is
2.) remove transparency for this color and set a different color for transparency
Help on either question would be MUCH apreciated.
Thanks
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
Is it possible to add buttons to list view at runtime in vb?
|
|
|
|
|
Yes, but you would have to draw them manually.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
I need to add buttons as list items. Can u tell me how to do that
|
|
|
|