Reputation: 2323
I'm working on an MVC3 project where I'm using an external library in my view to perform a specific function. However, when I try to reference the same library in my controller code, it can't be found (cue the "the type or namespace cannot be found" error).
Is there anything I can do to fix this? If not, is there a way that I can pull in a function/helper from my view into the controller code?
For example, in my Home/Index.cshtml file I'm referencing a library like so:
@using Amazon.S3.Model;
and I'm referencing the same library in my HomeController.cs file like so:
using Amazon.S3.Model;
Upvotes: 0
Views: 235
Reputation: 486
It's probable that in the Web.config inside your views folder there is an explicit reference to the Amazon.S3
library, but do you have a project reference for it? Check the references folder in your project and make sure that a reference exists.
Upvotes: 1