Reputation: 844
I got a main website(Net 4.5.2) in my IIS. Then I create separate webapi(Net 4.7.2) and run it as virtual application inside the main website. But, when I test the webapi to GET a data, it will give me an error about missing assembly reference. Below is the error.
Parser Error Message: Could not load file or assembly 'System.Web.Optimization' or one of its dependencies. The system cannot find the file specified.
Then I install this missing assembly to the webapi and then its working perfectly.
So, the problem is:
Upvotes: 2
Views: 990
Reputation: 844
I found an answer for this. It because of inheritance to the nested application in the IIS. Need to set inheritance to child application false in the main site web.config. Here is the solution link to this issue.
<location path="." inheritInChildApplications="false">
<system.web>
<!-- ... -->
</system.web>
</location>
Upvotes: 2