Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have a simple ASP.Net web application which reads the data from an Excel file and displays its content in web page on a button click event. I have deployed the website in IIS (Windows Server 2012 R2), it is working fine till login, but nothing happens when I click the button and try to load the excel data in webpage.

What I have tried:

I have tried the same solution locally on the same server machine and it is working fine on that but after deployment it doesn't work. Can anyone plese tell what could be the issue. Even I am not getting any kind of error in console, just page gets refresh but data is not displaying. Could it be any permission related issue??

Thanks in advance...
Posted
Updated 8-Jan-19 18:30pm
Comments
F-ES Sitecore 8-Jan-19 7:30am    
Without knowing anything about how you have coded this I'm not sure how you think people can help you. If it works locally but not remotely then something is working on your local machine that isn't on the remote machine. If I had to guess then you're using Interop to read the Excel file and that isn't supported by asp.net so you won't get it working on a remote server.
RmcbainTheThird 8-Jan-19 8:20am    
Where is the Excel file located?
ZurdoDev 8-Jan-19 8:24am    
How can we help?
ZurdoDev 8-Jan-19 8:24am    
It's very likely either permissions, file paths, or a dependency is missing.

Because you haven't said anything about how your code is written, I'm going to take an educated guess.

You used Office Interop to read data from an Excel sheet. This means setting a reference to the Microsoft Office Object Library and/or the Microsoft Excel Object Library.

This will NOT work in a web application. Yes, I know it worked on your dev machine. That means nothing. The reason for this is on your dev machine, you are one user hitting the website with single requests. This is fine for Office to handle. But when you have multiple users all hitting the production site at the same time, this is where Office/Excel is going to have problems. Office applications do not support re-entrancey. This means it cannot handle multiple requests simultaneously, which is what websites do all the time.

Office also does not support being run from a non-user desktop, which is what IIS and Windows Services do. Some stuff in Office can be triggered that requires user interaction to complete. Since services run under a desktop that the user cannot see, these operations will never complete because they are waiting for input that will never show up.

There are other ways of reading data from an Excel sheet without using Interop at all. "Google: C# read data from excel using oledb[^]"
 
Share this answer
 
Thanks for Reply.

Issue has been resolved...

I just make a change in settings

Application Pools -> Enable 32 bit applications -True

Thanks a lot
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900