Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add Reflection Permission to IIS or to add it to web.config?

I'm using FileHelpers for reading csv files, and all it was ok until I switched from VS dev server to IIS, I get a "PolicyException: Required permissions cannot be acquired", I googled and found that I need to add Reflection Permission for this to work, anybody knows how ?

like image 704
Omu Avatar asked Dec 04 '09 09:12

Omu


People also ask

What is web config file in IIS?

The web. config is a file that is read by IIS and the ASP.NET Core Module to configure an app hosted with IIS.

Where is web config file in Visual Studio 2022?

config file is located in the %SystemRoot%\Microsoft.NET\Framework\%VersionNumber%\CONFIG\ folder. The default settings that are contained in the Machine.

What is web config?

A web. config file is a Windows file that lets you customize the way your site or a specific directory on your site behaves. For example, if you place a web. config file in your root directory, it will affect your entire site (www.coolexample.com).


1 Answers

Your asp.net application is probably running in low-trust or medium trust. Reflection permission is in full trust.

You can enable this specific Reflection Permission without going full trust by following this post by Rick Strahl :

http://www.west-wind.com/Weblog/posts/6344.aspx

Note: it might not work if you're hosted and don't have permissions to override some security settings.

like image 54
Yann Schwartz Avatar answered Nov 09 '22 20:11

Yann Schwartz