1

I have an .aspx page (using MVC 2)

When i'm trying to make an actionlink i get an error (you can see below). This code worked already, but since i updated my project (it's a silverlight project) to .net 4.0 it gives me that error..

Error:

CS0012: The type 'System.Xml.IXmlLineInfo' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.

Code:

<ul>
 <% foreach (var item in dossier.Flows){%>
  <li title='<%=item.Name %>' >
    <%if (item.Name.Length > 30) item.Name = item.Name.Substring(0, 30); %>

<%= Html.ActionLink(item.Name, "Index", "Main" , new { token = Model.Token, dossiersId = dossier.Id, usersId = Model.usersId, flowsid = item.Id }, null)%>
 </li>
 <%} %>
</ul>

someone who knows what to do? or had this problem before and fixed it?

Fixed it on this way:

<ul>
                    <% foreach (var item in dossier.Flows){%>
                <%--    <%if(item.Name.Length > 20) %>--%>
                        <li title='<%=item.Name %>' >

                        <%if (item.Name.Length > 30) item.Name = item.Name.Substring(0, 30); %>
                            <a href='<%=item.IntranetLink %>'> <%--  <href><%= Model.IntranetUrl %></href>--%>
                            <%= item.Name %>
                            </a>

                        <%--<%= Html.ActionLink(item.Name, "Index", "Main" , new { token = Model.Token, dossiersId = dossier.Id, usersId = Model.usersId, flowsid = item.Id }, null)%>--%>
                        </li>
                    <%} %>
                </ul>
Jordy
  • 978
  • 2
  • 10
  • 20
  • Jordy, did you find any solution for that? I have a similar problem... Would be very graceful for any idea! – Budda Jan 13 '11 at 02:32
  • I did not realy solved the problem, i'm not using Html.ActionLink anymore. I edited my question, you can find my solution there – Jordy Jan 18 '11 at 17:19

2 Answers2

0

That problem is covered here: Strange Error - CS0012: The type x is defined in an assembly that is not referenced

Community
  • 1
  • 1
iCollect.it Ltd
  • 92,391
  • 25
  • 181
  • 202
  • i've readed that post, but it didn't solve my problem. The thing that's strange is, there is a system.xml in my references, but it's version 4.0.0.0, so id don't know why my application is referring to 2.0.5.0? – Jordy Sep 17 '10 at 07:28
  • i just tried to debug the project on another computer, and there it works without getting the error. Do i need to (re)install something? – Jordy Sep 17 '10 at 08:26
0

It is because of cached reference during compilation. Refer this blog

Lav G
  • 153
  • 9