473,473 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Error 1312 when Mapping drives.

Hello All,

I have a web application that is required to copy a file from the
WebServer to a remote web server (staging server to production
server).

I've created an application that maps the network drive, then moves a
specified file to the remote server. I've imported the SDK API
"WNetAddConnection2A" to map the network drive.

This work perfectly when I'm "Remoted" in to the staging server and
call my app from the command line. But my transfer app fails when
called from the Web App.

In my web app, I've tried creating a Process to start my app, and I've
tried importing my app directly into the web app and mapping the drive
directly from the web app.

In both cases, I'm getting a '1312' error ("A specified logon session
does not exist. It may already have been terminated.").

I need help in
1. Understanding what this error means,
2. Coming up with a solution to this issue.

Background:
This is a a C# app.
The command line app simply takes a filename as a parameter. A network
drive is mapped and the file is copied to the production server,
placed in the same locaton as the source file.

The command-line app uses a config file to read the remote server path
to be mapped, the desired drive letter, a username/password valid on
the remote machine). So the same values are used in the command line
app as in the we app.

Again, this works from the command line, but not from a web app.

I suspect that this is because the command line version is called when
I am logged in to the staging server as 'user' while the web app is
running as 'aspnet'. But I don't understand what the differece is
since the app is passing the username/password to the production
server when trying to map the drive.

All help is appreciated (greatly).

-tomas
/*-------------------------------
* Tomas Vera
* tomas (at) sbcglobal (dot) net
*-------------------------------
*/
May 21 '06 #1
2 9879
try to use domainname\username to mp. this link may help,

System Errors System error 1311 - There are currently no logon servers available to service the logon request System error 1312 has occurred - - A specified logon session ...
www.chicagotech.net/systemerrors.htm
Bob Lin, MS-MVP, MCSE & CNE
Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net
How to Setup Windows, Network, VPN & Remote Access on http://www.HowToNetworking.com
"Tomas Vera" <tavera@NO_SPAM_sbcglobal.net> wrote in message news:5q********************************@4ax.com...
Hello All,

I have a web application that is required to copy a file from the
WebServer to a remote web server (staging server to production
server).

I've created an application that maps the network drive, then moves a
specified file to the remote server. I've imported the SDK API
"WNetAddConnection2A" to map the network drive.

This work perfectly when I'm "Remoted" in to the staging server and
call my app from the command line. But my transfer app fails when
called from the Web App.

In my web app, I've tried creating a Process to start my app, and I've
tried importing my app directly into the web app and mapping the drive
directly from the web app.

In both cases, I'm getting a '1312' error ("A specified logon session
does not exist. It may already have been terminated.").

I need help in
1. Understanding what this error means,
2. Coming up with a solution to this issue.

Background:
This is a a C# app.
The command line app simply takes a filename as a parameter. A network
drive is mapped and the file is copied to the production server,
placed in the same locaton as the source file.

The command-line app uses a config file to read the remote server path
to be mapped, the desired drive letter, a username/password valid on
the remote machine). So the same values are used in the command line
app as in the we app.

Again, this works from the command line, but not from a web app.

I suspect that this is because the command line version is called when
I am logged in to the staging server as 'user' while the web app is
running as 'aspnet'. But I don't understand what the differece is
since the app is passing the username/password to the production
server when trying to map the drive.

All help is appreciated (greatly).

-tomas
/*-------------------------------
* Tomas Vera
* tomas (at) sbcglobal (dot) net
*-------------------------------
*/
May 22 '06 #2
You need to impersonate, aspnet is a local account which cannot be used to
access remote resources.
Please search "How To: Use Impersonation and Delegation in ASP.NET 2.0"
in msdn for more details.

Willy.

"Tomas Vera" <tavera@NO_SPAM_sbcglobal.net> wrote in message
news:5q********************************@4ax.com...
| Hello All,
|
| I have a web application that is required to copy a file from the
| WebServer to a remote web server (staging server to production
| server).
|
| I've created an application that maps the network drive, then moves a
| specified file to the remote server. I've imported the SDK API
| "WNetAddConnection2A" to map the network drive.
|
| This work perfectly when I'm "Remoted" in to the staging server and
| call my app from the command line. But my transfer app fails when
| called from the Web App.
|
| In my web app, I've tried creating a Process to start my app, and I've
| tried importing my app directly into the web app and mapping the drive
| directly from the web app.
|
| In both cases, I'm getting a '1312' error ("A specified logon session
| does not exist. It may already have been terminated.").
|
| I need help in
| 1. Understanding what this error means,
| 2. Coming up with a solution to this issue.
|
| Background:
| This is a a C# app.
| The command line app simply takes a filename as a parameter. A network
| drive is mapped and the file is copied to the production server,
| placed in the same locaton as the source file.
|
| The command-line app uses a config file to read the remote server path
| to be mapped, the desired drive letter, a username/password valid on
| the remote machine). So the same values are used in the command line
| app as in the we app.
|
| Again, this works from the command line, but not from a web app.
|
| I suspect that this is because the command line version is called when
| I am logged in to the staging server as 'user' while the web app is
| running as 'aspnet'. But I don't understand what the differece is
| since the app is passing the username/password to the production
| server when trying to map the drive.
|
| All help is appreciated (greatly).
|
| -tomas
| /*-------------------------------
| * Tomas Vera
| * tomas (at) sbcglobal (dot) net
| *-------------------------------
| */
May 22 '06 #3

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

Similar topics

4
by: Dhruv | last post by:
Hi, I was wondering is there a way to map a network drive a on persons machine with a online gui interface? Is there a way user 1 can map drives on THEIR computer using an online interface? ...
7
by: Eric.Jones | last post by:
I've encountered a strange error with loading delimited files from a Samba (SMB) network drive, has anyone else seen this before? (Platform: WinXP Pro, UDB PE 8015, level 02060106, SAMPLE db) ...
2
by: Dennis | last post by:
I have the following code that works fine on my Development Computer but not on my other computer. Both Computers are running Windows XP Pro and both have .netFramework 1.1 installed. The last...
3
by: GWold | last post by:
Hi all! I'm trying to figure out how to map a network drive in VB.NET/.NET Framework. I understand that I can add references to wscript and the scripting runtime library, but I want to do it...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
3
by: jer006 | last post by:
Hi I am writing a select statement that has an arithmetic function inside a case statement that uses logic to decide whether to divide or multiply and when I run the arithmetic statements outside...
10
by: =?Utf-8?B?Z3JlYXRiYXJyaWVyODY=?= | last post by:
Sorry about that previous one. I pressed enter too early. How does one go about mapping a network drive in C#. i know you use MapNetworkDrive in scripting languages, but i'm not sure how to do it...
0
by: Daffydd | last post by:
Hi all, This one's driving me up a wall! We have a small office network, Windows SBS 2003, nothing fancy - recently upgraded from an old Compaq running Novell. Back in the day we used the "F"...
2
by: =?Utf-8?B?U2NvdHQ=?= | last post by:
I have seen numerous posts, both here and google, where people are having this issue, but I have yet to see an explanation of the problem. I have a WCF service that is working fine using http....
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.