I wrote a rest app in C#, in one solution I have two projects. Main project, lets say project1 uses project2. Project2 is connected via reference system and adequate dll is created when I publish project1. After that publish project1 is hosted on IIS. In this moment everything works as it should be, application is accessible. However when I change something (like connectionstring) in web config in given application (project1) or even some other application in the same node (application pool) suddenly the application (project1) is no longer available. Error looks like project2 somehow unloaded itself from published version but dll is still in a source folder.
Others in node work just fine.To fix this I swap files in source folder except config and it works again until I change something. I can not find any solution to this. Maybe someone encountered similar problem and found a solution. I will be thankful for any help.
Edit: I've just found that when I add reference to the project1 and then compile it, everything is fine, but I can not do it again because of error same as above. I need to delete and add new reference again to make it work.