Advertisements

Archive

Posts Tagged ‘Access is denied’

System.UnauthorizedAccessException – Windows Phone 8 application

These days I started practicing windows phone 8 applications.
In my first application, I tried to call a number using Windows Phone Stack using below code.

WP 8 Phone DIaler

WP 8 Phone DIaler

PhoneCallTask phoneCallTask = new PhoneCallTask();

phoneCallTask.PhoneNumber = “1234567890”;

phoneCallTask.DisplayName = “Rajeev”;

phoneCallTask.Show();

While executing the code block I got below exception

An unhandled exception of type ‘System.UnauthorizedAccessException’ occurred in System.Windows.ni.dll

Access Denied WP8

Access Denied WP8

Fix

  • We have to enable ‘Phone Dialer’ capability in ‘WMAppManifest.xml’ file
  • In the Project ,open ‘WMAppManifest.xml’ file under ‘Properties’ folder
  • Go to ‘Capabilities’ tab and check ‘ID_CAP_PHONEDIALER’ check box.
WMAppManifest

WMAppManifest

App Manifest file

  • Each Windows Phone app has a manifest file that contains details about the app, such as the App ID and the capabilities that the app uses.
Advertisements

Access denied to temporary Asp.net files folder – error while browsing Aspx page

February 20, 2013 Leave a comment

I was getting below “Access denied” error, when I was browsing my Aspx page hosted in IIS 7.

Access denied Aspx page

Access denied temp Asp.net files

Hers are more details about my hosted Asp.net web application

  • Website application pool’s Pipeline mode is “Integrated”
  • Application pool Identity set to a Service Account

Below is the reason and fix that worked in my case

Reason

  • Issue seems a permission issue to access the temporary folder, for the account under which the website is running.
  • In our scenario, it’s the “Service Account” under which website is running does not have write access to Temp folder

Fix 1

  •  Provide “Write” access to the “C:\Windows\Temp” folder, to the Account under which your application running

Fix 2

  • Grant the required permissions to the “Service Account” by running Aspnet_regiis.exe -ga [User id]
    • So it grants the specified user or group access to the IIS metabase and other directories that are used by ASP.NET.
    • We typically use this option when creating a custom service account.
Grant Access

Grant Access

🙂