0

I'm trying, through the action of a button on my website, to open a file that is on my company's network. Running the application only through visual studio, the file opens without problems. But when I register it in IIS, this problem happens. Through IIS I can't access the file, this message appears, as shown below:

Open file print

System.ComponentModel.Win32Exception: 'The specified network password is not correct'

For the network drives to be visible to me on my computer, every time I turn on the computer, I must enter the network username and password novel: Client for Open Enterprise Server 2 SP4 (IR7a). After login, the network drives appear. In one of these units is where I want to access a file through my website. I believe the problem is in the configuration of IIS. I configured authentication in IIS to be anonymous. I don't know how to configure it differently.

Would anyone know how to solve this problem?
Thank you very much in advance.

An addendum:
These are the mapped drives. I want to access the file of one of them through IIS: Mapped drives

Addendum 2:

I found that I can't access local documents through IIS either. I can see the error through debug, with VS configuration in IIS Local. If I configure in visual studio for it to run the application in IIS Local, the document access problem occurs. I can't open the files through the button on my website. As shown in the picture in the link: IIS configuration

When I open IIS, and I click on the page link, as shown: Internet Information Service Manager - IIS, access problem occurs.

If I'm running Visual Studio with IIS Local configured, I can debug and see the problem.

If I run Visual Studio in IIS Express, I can access and open the files through the click of the button on my website, normally.

I just don't want to have to do this every time I need to run my site.

I want my site to work without needing to run visual studio.

  • IIS/ASP.NET does not support mapped drives, if that's the "network drives" you were referring to. – Lex Li Apr 27 '22 at 12:58
  • Thank you for replying. I want to access a document through one of the network mappings. These mappings only appear if I login to the novell network. When I run the application in visual studio in C#, when I click on my application's button, I can access the file without any problems. But if I publish my application in IIS, I can't access the file. The message appears: 'The specified network password is not correct' – Bianca Nunes Apr 27 '22 at 14:12
  • Something running in VS doesn't always run on IIS, as there are fundamental differences out there, https://blog.lextudio.com/web-application-differences-in-visual-studio-and-iis-60fec7e311b3 – Lex Li Apr 27 '22 at 15:41
  • I noticed that local directory files don't open either. – Bianca Nunes Apr 27 '22 at 17:20
  • Is your problem solved? – samwu Apr 28 '22 at 09:49
  • Unfortunately not. – Bianca Nunes Apr 28 '22 at 11:21
  • First of all, if there is an error in your vs, then there must be a problem with publishing to iis. Also, if you are using anonymous authentication, you do not need to enter the username and password. and how do you access mapped drives in your application? please post more details information about your requirement. – samwu Apr 29 '22 at 07:34
  • There is no error in my Visual Studio. I believe the problem is in the configuration of IIS. Because running the site in visual studio, configured in IIS Express, I can open the files. But if I run visual studio configured in IIS Local, I can't open the files. My site only works with visual studio running. If I access the site through IIS without running visual studio, I can't open the files. I put an Addendum 2 with image links. There, I explain the situation better. Thanks for listening. – Bianca Nunes Apr 29 '22 at 12:09
  • It is difficult to reproduce your problem, I suggest you open a case via: https://support.microsoft.com. – samwu May 02 '22 at 09:42

0 Answers0