VS2013 is different from VS2010 and I cannot access the network drive from a Windows application

I can’t work with this!

Create a Windows VS2010 application that simply executes FileInfo ("Y: /test.txt") and works fine when debugging FileInfo.

Do exactly the same with VS2013, and the report file was not found.

So, there is some kind of trust or issue issue, this is a Windows application, although I use VS2013 as an administrator.

It drives me crazy - who has any ideas?

thanks Paul

+8
security c # visual-studio-2013 networking mapped-drive
source share
1 answer

When UAC is turned on in Windows and you are a member of the Administrators group, you actually have two login sessions - one as an ordinary user and one as an administrator. Your mapped drives are only associated with your regular login session, so when you run the program as an administrator, it does not see mapped drives.

This link contains more detailed information and a workaround (which I myself have not tried!) Related to modifying the registry:

To work around this problem, configure the EnableLinkedConnections registry value. This value allows Windows Vista and Windows 7 to exchange network connections between the filtered access token and the access token to access the group of administrators. After setting this registry value, the LSA checks for another access token associated with the current user session if the network resource is mapped to an access token. If the LSA determines that there is an associated access token, it adds the network share to the associated location. To configure the EnableLinkedConnections registry value

  • Click Start, type regedit in the Start Programs and Files box, and then press ENTER.

  • Locate and right-click the registry subkey HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Policies \ System.

  • Specify "Create" and then "DWORD Value".

  • Type EnableLinkedConnections, and then press ENTER.

  • Right-click EnableLinkedConnections and choose Modify.

  • In the Value field, enter 1, and then click OK.

  • Close the registry editor and restart the computer.

+9
source share

All Articles