Windows Azure: System.UnauthorizedAccessException: Access to the path 'E:\approot\ - c#

I have an xml file in my project that is supposed to be for used for read operations. And it works the project works fine when i run it on my local machine, however it throws System.UnauthorizedAccessException: Access to the path 'E:\approot\... when i deploy the worker role.
I have checked that the file exists in that directory.
How can i fix this issue?
Thank you.

You need to run role in elevated mode...by adding
< Runtime executionContext ="elevated" /> in csdef.

Related

CSC : error CS7028: Error signing output with public key from container 'Container' -- The file exists. [lgw0hqij.tmp_proj]

We had a Jenkins job running without issues for a couple of months now but recently it started failing.
It has this error when running form Jenkins:
CSC : error CS7028: Error signing output with public key from container 'Container_ID' -- The file exists. [lgw0hqij.tmp_proj]
It seems to rename the file every time.
I have logged into the host and executed as the user but it gives no error when running normally.
Once I run the user as an administrator, it starts giving the issue.
Running the application from Visual Studio does not give an issue at all!
I have tried running Jenkins as a LocalService as well as a lower privileged user, but same result.
I have also followed this, but doesn't seem to help.
I'm running out of ideas
EDIT
For anyone facing the same issue in the future. This error is linked to the user account temp folder
C:\Users\<username>\AppData\Local\Temp
Once you clear this folder, your msbuild should be working fine
For anyone facing the same issue in the future. This error is linked to the user account temp folder
C:\Users\<username>\AppData\Local\Temp
Once you clear this folder, your msbuild should be working fine

App OnStartup Error: Access to path 'C:\Users\<userid>\AppData\Local\AppName\VersionFolder\Some.dll' is denied

I have a desktop application that has a setup.exe built by Squirrel.
The app files get downloaded to the users machine at this location:
C:\Users\<userid>\AppData\Local\AppName\VersionFolder\
And a short cut is created on the desktop. For some users, when they run the application, they get the error
"App OnStartup Error: Access to path C:\Users\\AppData\Local\AppName\VersionFolder\Some.dll is denied."
Not sure what's going on?
It works fine for me and few other users. One of users who get this error has admin rights to their pc. Any help would be greatly appreciated.

Access to Path Denied - Magick.NET.net40.7.4.3.0

I am trying to read text from images using IronOCR. It worked fine on my dev machine but when I try run it through IIS on another machine I am getting the following error
Access to the path 'C:\Windows\TEMP\Magick.NET.net40.7.4.3.0\Magick.NET-Q8-x64.Native.dll' is denied.
there is no Magick.NET.net40.7.4.3.0 folder in the window temp folder location on the dev machine, but it was there on the other machine but it was empty. I deleted the folder and now it is saying there is access denied on the user app_data folder.
I am totally confused as to why it is looking for access to Magick.NET.net40.7.4.3.0, is there some connection between the 2?
In your code you'll need to set :
IronOcrInstallation.InstallationPath = "d:\newpath"
where d:\newpath is a directory on your IIS that your worker process or IIS has access to.
BTW IronOCR is a commercial re-bundling of the open source Magick.NET image and Tesseract OCR libraries.

FileLoadException - acces denied in SharePoint application bin directory

I have following lines of code:
System.Reflection.AssemblyName assemblyName =
System.Reflection.AssemblyName.GetAssemblyName(#"C:\inetpub\wwwroot\wss\VirtualDirectories\22687\bin\log4net.dll");
After executing it, I get a System.IO.FileLoadException - Could not load file or assembly or one of its dependencies. Access is denied..
If i copy the file and try the same in a different directory (for example: #"C:\inetpub\wwwroot\wss\VirtualDirectories\22687\log4net.dll") I don't get the Exception, even if I set the permission for the file exactly the same.
Can anyone point me to the right direction?
I'm running Windows Server 2008R2, SharePoint 2010, IIS7 and Visual Studio 2010.
edit: It works on LINQPad. I run the Application from the IIS App Pool under the same user as the LINQPad Process.

Deployment issue with Azure Emulator

I'm trying to run a local instance of an Azure Worker Role for debugging and testing, but for some reason, my Role will not deploy to the Emulator locally, it is saying, "The compute emulator had a error: Found too many .csdef files.."
The problem is, I checked the project directory, and there is only one csdef file...
I have already built the file as required with CSPack, and my CSRun command looks like this:
csrun.exe /run:C:\ODA
T\WorkerRole\WorkerRole;C:\ODAT\WorkerRole\WorkerRole\
ServiceDefinition.csdef
And this is being ran at the following director: C:\Program Files\Windows Azure Emulator\emulator
Any help is greatly appreciated!
Try using the cscfg file not the csdef and use the .csx directory for the emulator.
csrun C:\ODAT\WorkerRole\WorkerRole.csx C:\ODAT\WorkerRole\WorkerRole.cscfg
If you don't have a .cscfg file you can have cspack create it for you by specifying the /generateConfigurationFile:ServiceConfiguration.cscfg

Categories