A
A
Alvaro2012-12-27 11:49:47
ASP.NET
Alvaro, 2012-12-27 11:49:47

Is it necessary to set copy local = true in ASP.Net MVC 4 for System.Web.Mvc assemblies?

Good afternoon. Without Copy Local = true, it refuses to understand namespace references in web.config(add namespace="System.Web.Mvc.Ajax"). MVC assemblies are registered with the GAC. Gives something like this (depending on web.config):
Error c:\Users\User1\AppData\Local\Temp\Temporary ASP.NET Files\root\25d45b26\3acd56a8\App_Web_http404.cshtml.62599428.b6svn1m5.0.cs (24): error CS0234: Type or namespace name 'Ajax' does not exist in namespace 'System.Web.Mvc' (Missed assembly reference?)
Temorary Files cleared. I use IIS Express 8. The question is simple, is the presence of libraries in bin required?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SychevIgor, 2012-12-29
@SychevIgor

Not required, but it's best to do so.
The reason is that you never know if these libraries will be on the server ... if not, this is half the trouble, the project simply will not start. Worse, if there are not the same version and the project will load, but will fall out in arbitrary places.
Therefore, it is always recommended to install mvc4 from nuget and carry all your dependencies with you.
Additionally, it is recommended to prescribe the exact versions in the runtime config section ... The runtime may supply the wrong version of the library. I already had fun with this in the fall. I had to check the versions of all assemblies loaded in IIS and eventually find that the system.web.razor assembly was not the same version.
In general, it’s better to carry everything with you, never when you don’t know what is on the host

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question