Releasing my VB.NET app over the intranet

S

Schoo

I am trying to release my vb.net app over our intranet to the users and when
I navigate to it I get the following on my screen:
============================
=== Pre-bind state information ===
LOG: DisplayName = OnCallDB, Version=1.0.1733.16596, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = C:\Inetpub\wwwroot\Programs\
LOG: Initial PrivatePath = NULL
Calling assembly : OnCall, Version=1.0.1733.16596, Culture=neutral,
PublicKeyToken=null.
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: OnCallDB, Version=1.0.1733.16596,
Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL
file:///C:/Inetpub/wwwroot/Programs/OnCallDB.DLL.
LOG: Attempting download of new URL
file:///C:/Inetpub/wwwroot/Programs/OnCallDB/OnCallDB.DLL.
LOG: Attempting download of new URL
file:///C:/Inetpub/wwwroot/Programs/OnCallDB.EXE.
LOG: Attempting download of new URL
file:///C:/Inetpub/wwwroot/Programs/OnCallDB/OnCallDB.EXE.
===========================

I have done the following:
Loaded framework 1.0 on the client which is running Windows 98SE
Changed the permissions of the virtual directory on the server (W2K Server)
to open it up to Everyone group.
Added to the All Code section of the Framework Configuration tool on the
server.

Can't think of anything else. Is there something I am missing?

Schoo
 
P

Peter Huang

Hi Schoo,

I did not understanding your meaning very well, do you mean you have two
machine win98(A) and window 2000 (B).
Now you have deployed a window Form applictation on the window 2000's
virtual directory and you access to it by using the syntax something as
below.
http://B/Programs/test.exe

If I have any misunderstanding, please feel free to let me know.

I think you may take a look at the link below.
Security and Versioning Models in the Windows Forms Engine Help You Create
and Deploy Smart Clients
http://msdn.microsoft.com/msdnmag/issues/02/07/NetSmartClients/default.aspx

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Schoo

Peter,

Thank you for your response. It sounds like your understanding of my
problem is correct. I would add for clarity that I am trying to allow out
intranet users to access the EXE from their W98 workstations and the EXE is
sitting on our web server which is a W2K box. I went to a user location
this morning and had to download the EXE to their hard drive (along with the
DLLs) and it worked (after loading MDAC and the framework). Now the trick
is to do that over an intranet location so I can keep them updated with
feature improvements. The goal is for me to make improvements on my
development workstation, copy the EXE/DLL file(s) to the web server and the
next time the users try to use the program they will see the latest version.

I went through the Chris Sells article you mentioned and what he is doing is
pertinent to my situation, but he doesn't seem to go into how to deal with
the DLLs. Here is what is happening:

I create a project and put some simple controls on it, compile it, right
click on the debug folder, enable the web share and navigate to it using
http://localhost/<virtual name>/<app name>.exe which works fine... I see the
application. If I do that same thing with my real app it does not work (see
below). There are two differences between the simple app and the one I am
working on:
1) My app uses a DLL that I designed as part of the app. The DLL
performs my database access (SQL2000)
2) The simple app does not try to access a database, mine does. On
load of my app, it has to access the database.

Keep in mind that when I copy the contents of the bin directory to a W98
workstation, it works fine (including access to the database over the WAN).
However, even if I am on my own development workstation and try to type in
the URL for the EXE it will return the following:

===========================================================
=== Pre-bind state information ===
LOG: DisplayName = OnCallDB, Version=1.0.1735.18086, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = C:\Documents and Settings\sschum\My Documents\Visual Studio
Projects\OnCall\obj\Debug\
LOG: Initial PrivatePath = NULL
Calling assembly : OnCall, Version=1.0.1735.18086, Culture=neutral,
PublicKeyToken=null.
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: OnCallDB, Version=1.0.1735.18086,
Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL file:///C:/Documents and
Settings/sschum/My Documents/Visual Studio
Projects/OnCall/obj/Debug/OnCallDB.DLL.
LOG: Attempting download of new URL file:///C:/Documents and
Settings/sschum/My Documents/Visual Studio
Projects/OnCall/obj/Debug/OnCallDB/OnCallDB.DLL.
LOG: Attempting download of new URL file:///C:/Documents and
Settings/sschum/My Documents/Visual Studio
Projects/OnCall/obj/Debug/OnCallDB.EXE.
LOG: Attempting download of new URL file:///C:/Documents and
Settings/sschum/My Documents/Visual Studio
Projects/OnCall/obj/Debug/OnCallDB/OnCallDB.EXE.
===========================================================
In addtion, if I am on my workstation and try to access the simple
application the same way, it loads the app successfully.

I suspect my problems have something to do with the fact that I have a DLL
that has to be accessed as well.

I hope this helps in your analysis of my problem and give you an idea on how
it needs to be corrected.

Schoo
 
P

Peter Huang

Hi Schoo,

From the msdn as below, if our no-touch deployment application needs
another dll, we need to put the dll in the same directory, so that the clr
will probe and load it.

Put your executable out on a remote Web server, and let the user navigate
to it by entering the URL in Microsoft Internet Explorer or by clicking on
a hyperlink to that URL (for example, http://RemoteWebServer/myExe.exe).
The executable will be downloaded to the assembly download cache on the
client machine and launched from that location. DLLs required by the
executable can be referenced as normal in your code. Unless informed
otherwise (see #2 below), the common language runtime (CLR) will look for
the DLLs in the same directory on the remote Web server as the executable,
and the CLR will download them into the assembly download cache from there,
as needed.

Implementing No-Touch Deployment
http://msdn.microsoft.com/netframework/using/building/windows/analystreports
/smartclient.aspx

I am not sure if you have copy your windows application together with
OnCallDB.DLL in the same directory of the windows application EXE image,
you may have a try if you did not do that.

Also if we did not put the dll in the same directory of the exe image, we
will get the binding log as below.
Please note that the clr will try to probe the dll in the directory where
the Appbase pointed to, i.e. the http://localhost.

=== Pre-bind state information ===
LOG: DisplayName = NoTouchDeploymentLib, Version=1.0.1739.17524,
Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = http://localhost
LOG: Initial PrivatePath = bin
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : NoTouchDeployment, Version=1.0.1739.17484,
Culture=neutral, PublicKeyToken=null.
===

LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: NoTouchDeploymentLib, Version=1.0.1739.17524,
Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL
http://localhost/NoTouchDeploymentLib.DLL.
LOG: Attempting download of new URL
http://localhost/NoTouchDeploymentLib/NoTouchDeploymentLib.DLL.
LOG: Attempting download of new URL
http://localhost/bin/NoTouchDeploymentLib.DLL.
LOG: Attempting download of new URL
http://localhost/bin/NoTouchDeploymentLib/NoTouchDeploymentLib.DLL.
LOG: Attempting download of new URL
http://localhost/NoTouchDeploymentLib.EXE.
LOG: Attempting download of new URL
http://localhost/NoTouchDeploymentLib/NoTouchDeploymentLib.EXE.
LOG: Attempting download of new URL
http://localhost/bin/NoTouchDeploymentLib.EXE.
LOG: Attempting download of new URL
http://localhost/bin/NoTouchDeploymentLib/NoTouchDeploymentLib.EXE.
LOG: All probing URLs attempted and failed.

Here I assume that the fuslogvw log you provided is when you access to the
exe in the syntax as below.
http://webserver/testapp.exe

So I think the binding log should be in the directory as below.
http://webserver

So far it is strange that the clr will check the path as file:///c:/....,
can you double check if you access to the exe using url.
1. open internet explore
2. access the exe in the url address bar, Http://webserver/testapp.exe

You may have a try and let me know the result.


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Schoo

Peter,

Thank you for your reply. My application is not very complex. It consists
of the primary EXE (OnCall.EXE) and when compiled I am copying the contents
of the bin directory which contains the OnCall.EXE and 3 other files:

OnCallDB.dll [used by OnCall.EXE which performs all the database calls for
the app]
Microsoft.ApplicationBlocks.Data.dll [used by OnCallDB.dll]
OnCall.pdb [I believe this is not used during runtime as this is the debug
file]

So, when I compile I am selecting "Release" or "Debug" from the compile type
dropdown and then I click on "Build"/"Build Solution". As a confirmation,
it appears to be updating the EXE and DLL files in the bin directory of the
app.

I then created a virtual directory on our W2K web server (which is hosting a
handful of ASP.NET apps), and give the directory all the rights I can except
"Write". I right click on the folder in file explorer, select "properties",
go to the "security" tab and make sure "Everyone" is on the list with all
rights except write and modify. Then I copy the 4 files explained above to
the directory and open a browser (IE 6.0) on the web server and type
http://localhost/Oncall/oncall.exe into the address line. After an unusual
long time of trying, I am now getting the following error in the browser:
"CGI Timeout... The server has deleted the process".

If I then close down the browser window and double click the Oncall.exe file
in the file explorer it runs quickly and runs fine. I also tried typing the
long version of the address without using the virtual directory name. Same
outcome.

I created another simple program that does not use DLLs but returns the
Products table from Northwind database in SQL Server. I get the same
results as I do with the Oncall program.

I read through the msdn paper you sent and it did not contain information
that indicated what I might be doing wrong.

You want me to send you the files and you can try running them on a web
server? As I mentioned, I think it is odd that I can run a simple app that
doesn't access a database and get it to run fine by typing the EXE into the
address line, but when I try it with DLLs used in the app, it doesn't work.

In the mean-time I am going to copy the app to the user's desktops for the
time-being until I can get this resolved. Do you know of any how-to docs
that talk about settings or exactly how to do this when you have an app that
uses DLLs and database access?

Schoo
 
P

Peter Huang

Hi Schoo,

I have searched the web, so far I did not find an article specified for
your scenario.
However, here is my test steps, you may have a try.
1. build the two projects
[Class Library]
Imports System.Data

Public Class Class1
Friend WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Public Sub New()
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
Me.SqlConnection1.ConnectionString = "Password=123;Persist Security
Info=True;User ID=sa;Initial Catalog=Northwind;Data Source=sha-vphuang-05"
End Sub
Public Function Test() As Integer
Me.SqlConnection1.Open()
Dim cmd As New SqlClient.SqlCommand("select count(*) from
customers", Me.SqlConnection1)
Dim dr As SqlClient.SqlDataReader = cmd.ExecuteReader
dr.Read()
Dim i As Integer = dr.GetInt32(0)
Me.SqlConnection1.Close()
Return i
End Function
End Class

[Winform]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim cls As New CallDB.Class1
MsgBox(cls.Test)
End Sub

2.build and put the two assemblies(exe and dll) into c:\inetpub\wwwroot

3. use the caspol.exe tool to disable the clr security check to simplify
the troubleshooting.
http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfcodeaccesssecurity
policyutilitycaspolexe.asp
run commandline
caspol -s off

4. open ie and run the url
http://localhost/testwinapp.exe

5.click the buttion the msgbox will return the record count.

If the test program still did not work on your machine, I think you may try
to test the application on another machine or you may need to reinstall
.net framework and update IE to the newest version.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top