简体   繁体   中英

C# - IIS don't load assemblies from PATH variable

I create web application and in AppStart I load some dlls by autofac . These are c++ dlls . I add the dlls to folder and I added the path of folder to PATH variable(environment variable) When I run the application from my vs - it's work well but when I deploy it to IIS the application doesn't find the dlls .

I set application pool 'Load User Profile' setting to true .

Does anyone have an idea ?

Can you look into the console when you run your application? Might give you more information. I had this problem too when deploying to iis(not with dll but other files) it may be the case that the file/directory doesnt grant access to iis.

If this is the case: what worked for me was: Go to you directory, Properties,Security,Edit,Add, Select all Object types,I selected the highest location just to be sure,IIS_IUSRS and give him the rights you want.

If the PATH environment variable is only being set for your account, you may need to change the account that IIS runs that application pool under.

Check the Identity setting under the Advanced Settings in the Application Pool. If it is set to ApplicationPoolIdentity (the default), try switching it to your account and see if that solves the problem. If it works you either need to update the PATH for the system or run the application pool under a different user from the default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM