I have a c# application where I have to have read/write access to the root of the C drive. I realize I can compile the code and run the executable as administrator and it works. But I need to debug it and I am unsure as to how one would start the app within Visual Studio.
I have tried adding:
<requestedExecutionLevel level="asInvoker" uiAccess="true" />
to my manifest but I still get access denied error.
Here is the line of code that fails:
MemoryMappedFile mmf = MemoryMappedFile.CreateFromFile(@"c:somemapnamefile.data", System.IO.FileMode.OpenOrCreate, "somemapname", 1000);
For now I have a work around but I'd like to know for the future.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…