Support is not able to solve OleDbPermission issue on ASP.NET 4.0 site since 30 hours.
See ticket [JH #IUY-56247-654].
Please someone senior look into this:
error is
System.Security.SecurityException: Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessSecurityEngine.Check(PermissionSet permSet, StackCrawlMark& stackMark)
at System.Security.PermissionSet.Demand()
at System.Data.Common.DbConnectionOptions.DemandPermission()
at System.Data.OleDb.OleDbConnection.PermissionDemand()
at System.Data.OleDb.OleDbConnectionFactory.PermissionDemand(DbConnection outerConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
Thank you Stephen, it is working now. Wish i had posted query here earlier, then i had not needed to wait for 34 hours.
But doesn’t support staff know anything about it?, i need to give a lot explanation it is not code issue, it requires change in config.
I has also sited old support ticket for the exactly same query on another server which was solved by Manish (also given name of Manish, saying he can solve it), also given link form MSDN what need to change where, but support staff keep raising questions on my code, instead of talking to senior.
Though i hardly need to raise support queries, thanks to hard work of admins servers work fine, but this was not good support experience.
Posting here would not have done much good.
I had my nose in Hyper-V deployment issues yesterday and just escaped to breathe this morning.
This issue was actually the 4.0 part, for some reason when it was mentioned to me yesterday it was checked on 2.0 config, not 4.0. 2.0 has been having oledbpermissions for…years.
We are not developers, and on weekend the developers are not in office to even ask a question. We get many developers that think they know it all (and I am not saying this about you) and what is safe and not, and dont understand the risks.
There is no issue in this permissions, but some others while there code may be 100% secure and all, the permission itself can open many issues on a shared server, for OTHER code.
Edit to add: and Manish was on his weekly off, just came into shift.
OleDBPermissions are in the config, and unrestricted allowed. (in 4.0 32bit and x64)
Many people are having issues with it if you check on google. Is there any alternative means?
I am talking about on win12 2008 server specifically, it seems that the same lines worked on others, aren’t working on 2008
when akshay replied I gave him a direct copy of the lines from the config, I also changed one aspect just to check if it worked, and seems it did no good.
I would have loved to be on Windows 2008 and take advantage of its IIS integration mode in future coding.
But for now making code working is on priority hence choosing to move to windows 2003 server.
It is more than 14 hours since transfer, still the site is down and no updates on ticket.
Please let me know how long it is going to take, i need to update client.
thank you, but my issue is still open, on win13 too it shows same error:
System.Security.SecurityException: Request for the permission of type ‘System.Data.OleDb.OleDbPermission, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed.
yes it is working now on win13.
How will you test it for win12 now as site moved to win13? if require i can prepare test code which you can try on any domain.
Find attached zip, extract and copy both files to any domain having ASP.NET support, and view TestExcel.aspx file in browser.
It will allow to upload .xls (Excel 97-2003 format) file and display its content if OleDbPermission is available.
It also require write access to App_Data folder, if it does not exists create folder first.