dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.27k stars 4.73k forks source link

Facing System.ArgumentException: Illegal characters in path at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath) #39415

Closed lohitakshgupta closed 4 years ago

lohitakshgupta commented 4 years ago

Description

I am facing System.ArgumentException: llegal characters in path at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath) error while converting a net452 project to nestandard2.0. This conversion is intended for Windows platform for now.

In order to debug, I tried print out the fullPath. The path seems to be fine with no illegal characters. It seems like a generic path which could be navigated.

Regression

This problem doesn't arise when I use net452 as my target framework. It arises for netcore/netstandard2.0 project files.

I am using Microsoft.Azure.Storage.DataMovement" Version="1.3.0" too.

Please let me know what would be your suggestions on this? Thank you!

Other information

Here's the call stack:

at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath) at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath) at System.IO.Path.GetFullPath(String path) at Microsoft.Azure.Storage.DataMovement.LongPath.GetFullPath(String path) at Microsoft.Azure.Storage.DataMovement.LongPath.ToUncPath(String path) at Microsoft.Azure.Storage.DataMovement.TransferControllers.StreamedWriter.<<HandleOutputStreamAsync>b__18_0>d.MoveNext()

ghost commented 4 years ago

Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq See info in area-owners.md if you want to be subscribed.

carlossanlop commented 4 years ago

Could it be possible that your string has null characters?

danmoseley commented 4 years ago

@lohitakshgupta ?

krwq commented 4 years ago

@lohitakshgupta can you share a tiny repro of the issue?

danmoseley commented 4 years ago

closing due to no response. Note that EmulateFileIOPermissionChecks is .NET Framework code.