May 30, 2014

New Application Installation Issues - Part 3

  • To read the first part of series. Click here. 
  • To read the second part of series. Click here.

Access to the path "C:\inetpub\TestSite\UploadFile\..." is denied


When you are going to upload the excel file or any other file to Server directory using the application module, sometimes you might be face the permission issue on that particular folder. Error is something like this:

"Access to the path "C:\intepub\TestSite\UploadFile\..." is denied."

To resolve the issue you have to create an object "IIS_IUSRS" and allow it the full control over that particular folder. Follow these steps to fix the issue.

1. Open the IIS Manager
2. Go to the Server directory
3. Go to the Sites directory
4. Go to the website directory
5. Right-click on folder “UploadFile”
6. Select “Edit Permissions…”
7. Select the “Security” tab
8. Then click on “Edit…” button
9. Click on “Add…” button
10. Add the “IIS_IUSRS” object name with Server name like (TestServer\IIS_IUSRS) in “Enter Object Name..” textbox
11. Then Click “OK”
12. Give the “IIS_IUSRS” object “Full Control”
13. Then click on “Apply” button
14. Finally click on “OK” button

After follow these steps, issue will be resolved. But if you uploading the Excel file on server from website and server donot contains the MS Office or require provider, then particular module will stop working. In this case it is also not showing any error and this is real pain for any developer. 

The next part of series contains the steps to fix that issue. Stay tuned.

New Application Installation Issues - Part 2

To read the first part of series. Click here.

Could not load file or assembly 'LinqToExcel' or one of its dependencies. An attempt was made to load a program with an incorrect format.



When you use the third party controls or api's into your application like installing from Nuget Package Manager you might face the error when you publish the application live.



Like I face the error after using the 'LinqToExcel' from Nuget Package Manager. Error is:

"Could not load file or assembly ‘LinqToExcel’ or one of its dependencies. An attempt was made to load a program with an incorrect format'.

This error raise when their is a version confliction occur. To resolve the issue you have to enable the application in 32 bit mode from IIS Manager. Follow these steps to fix the issue.

1. Open the IIS Manager
2. Go to the Server directory
3. Click on Application Pools
4. Right-click on “DefaultAppPool” if “DefaultAppPool” is set as ‘ApplicationPool’ for desire website else right-click on your custom pool name
5. Select “Advance Settings…”
6. In the “(General)” area, select the “Enable 32-Bit Applications” as “true”
7. Click “OK”

Here is the screenshot of the above workflow:

New Application Installation Issues - Part 1

To read the second part of series. Click here.

Login failed for user 'NT AUTHORITY\NETWORK SERVICE


When you first time publish your application to server and make it live. You might be face this error.

"Cannot open database requested by the login. The login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

This is very common error raised when you conifugure the application with IIS. Here IIS face the permission issue when tries to login into SQL Server.

To fix the issue, you have to create a new user and add the database roles to it. Follow these steps to fix the issue.

1. Login via SQL Server Management Studio
2. Go to the “Security” directory of the desire database
3. Right-click the “Users” directory
4. Select “New User…”
5. Add ‘NT AUTHORITY\NETWORK SERVICE’ as a new user
6. In the “Database Role Membership” area, select “db_datareader” and “db_datawriter”.
7. Click “OK”

Here is the screenshot of the above workflow: