ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 277.8k

System.io.ioexception: 'the network path was not found : '\\10.253.x.x

Mar 30 2022 7:34 PM

I work on csharp application when i make shared path and create directory in it it tell me

The network path was not found

so why this issue display

although i can create folder 3 on this path \\10.253.x.xx\ImportExport\testImporter\

but i can't create it from code

code i use it as below

from debug it have value

exception details

exception details

at System.IO.FileSystem.CreateDirectory(String fullPath)
at System.IO.Directory.CreateDirectory(String path)
at Framework.WebApi.Controllers.ZDataDelivery.Z2DeliveryController.Upload() in D:\moved\TestInternalSystemZ2Data\FullProjectAngApiLastUpdate\Z2DataApp\Framework.WebApi\Controllers\ZDataDelivery\Z2DeliveryController.cs:line 123
at lambda_method(Closure , Object , Object[] )
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()

 

PathDirectory = "\\\\10.253.x.xx\\ImportExport\\testImporter\\3"
 string PathDirectory = myValue1 + "\\" + Month;
 if (!Directory.Exists(PathDirectory))
                 {
    
                     Directory.CreateDirectory(PathDirectory);
    
                 }

i can access path above and create folder 3 on it manually

but from code it give me path was not found on network

so why this error display ?


Answers (2)