Add assembly reference in asp .net mvc 5

0

Good Day.

I have the following problem: Recently I migrated my web project asp .net mvc 4 to mvc 5 everything came out normal except for this part:

@if (Model.nombresAutocompletado.Count > 0)
{
    var empty = Model.nombresAutocompletado.ToArray();
    <script>
        $(function () {
            var availableTags = [
                @Html.Raw(
                    string.Join(",\n\t", 
                        empty.Select(x => String.Format("\"{0}\"", x.nombre))
                    )
                )
            ];
            $('#asociarCliente').autocomplete({
                source: availableTags
            });
        });
    </script>
}

My error is in @Html.Raw( , because when I open that page it shows compilation error I show you the capture.

If the page tells me this message

  

Compiler error message: CS0012: The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to the assembly 'System.Runtime, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a'.

I do not know how and where to add that reference I'm new to asp.net mvc 5.

    
asked by JuankGlezz 02.06.2016 в 17:27
source

1 answer

2

Investigating a little deeper in google I found a very next solution first I found in this blog something similar to my error.

Since I did not know exactly where to put the solution, I did another little research and I came across this example:

<configuration>
  <system.web>
   <compilation>
      <assemblies>
         <add assembly="System.Data, Version=1.0.2411.0, Culture=neutral,  PublicKeyToken=b77a5c561934e089"/>
      </assemblies>
   </compilation>
  </system.web>
</configuration>

And this cleared up the whole problem.

    
answered by 02.06.2016 / 20:06
source