[RESOLVED] web app unable to access remote file thru IIS 5.0
I have this web app that works just fine when I run it on IIS 6.0, but when I run it on a different machine with IIS 5.0, it ends up having file access problems. Basically, my web app uses a COM object, and this COM object uses resources, such as files, and these files are located in remote machines. A sample code would be:
Code:
MyComObj com = new MyComObj();
com.UseDataFiles("\\machineB\data.dat");
Again, it works fine on my machine with IIS 6.0, but in my other machine with IIS 5.0, it gives me an error. To be more precise, it's the COM object that gives me an error; the com object tells me that it can't find the file. What's weird is that when the web app calls this line:
System.IO.File.Exist("\\machineB\data.dat");
It returns True, which means my web app has permission to read, but when it does it through my com object, it can't see it. Again, I dont' think it's the COM object that has the problem since it runs fine on IIS 6.0. In fact, I ran a windows form application (that uses the COM) on the machine with IIS 5.0, and it works fine.
Any ideas?
Re: web app unable to access remote file thru IIS 5.0
I can't help but is this a real problem or your are just experimenting?
IIS5 is not on anything after winXP.
Re: web app unable to access remote file thru IIS 5.0
Hello,
This is going to come down to a permissions issue. Although your web application can "read" the file, the COM object probably can't. Which user is running the application pool in your IIS 6 server, and what user is running IIS 5 on the other machine?
Given the differences between IIS 5 and 6, i.e. one is intended for development purposes on a single machine, and the other for production hosting of websites, there is likely going to be differences in the way permissions is handled for COM objects. However, I can't speak to what these differences are, as I haven't done a lot of COM programming.
Gary
Re: web app unable to access remote file thru IIS 5.0
Quote:
Originally Posted by
sapator
I can't help but is this a real problem or your are just experimenting?
IIS5 is not on anything after winXP.
Bit of both. I don't HAVE to get it to work, but after the time I spent trying to figure it out, I'd LIKE to know why it is not working.
Re: web app unable to access remote file thru IIS 5.0
Quote:
Originally Posted by
gep13
Hello,
This is going to come down to a permissions issue. Although your web application can "read" the file, the COM object probably can't. Which user is running the application pool in your IIS 6 server, and what user is running IIS 5 on the other machine?
Given the differences between IIS 5 and 6, i.e. one is intended for development purposes on a single machine, and the other for production hosting of websites, there is likely going to be differences in the way permissions is handled for COM objects. However, I can't speak to what these differences are, as I haven't done a lot of COM programming.
Gary
Both are using the same Account since I set impersonation to true (along with userName and password).
Re: web app unable to access remote file thru IIS 5.0
I figured out a way to work around it. I just created a COM+ application (that would host my COM object) and set its Activation Type to "server" so it would run outside of my web app's process (since I know the COM object works fine outside of it).
Re: [RESOLVED] web app unable to access remote file thru IIS 5.0
Hey,
Glad to hear that you were able to find a workaround, and apologies for not being able to help directly.
Gary