Reputation: 61
We have created a solution in MVC 4, targeting .Net framework 4. On local IIS it runs like honey. But recently I Published it and copied all my data including Bin folder ( which includes dll dependencies of my project) to hosting server. But whenever I am trying to visit my domain
www.myexampledomain.com/
It returns nothing. But an error. that
Viewbag is not available in current context
Why M I getting this error. I found ASP.NET Versions 1 & 2 on my hosting account. Do I need to install .Net framework on server, if yes do I need to install MVC 4 too?
Upvotes: 0
Views: 627
Reputation: 61
After searching a lot and after reading comments n 5-10 trails , I found I made a small mistake by not setting CopyToLocal
property of every MVC referenced DLL to true
. It took me 2 days to resolve.
If you have same issue. kindly check on this solution too. It might help you!
Upvotes: 0
Reputation: 567
no need of MVC 4 to be install just install .net framework MVC 4 is for developing application in MVC pattern and .net framework is for provide runtime environment
Upvotes: 1