Build error: “An expression is too long or complex to compile”

后端 未结 10 1702
无人及你
无人及你 2020-12-11 15:57

Every now and then when I build a specific solution, I\'ll get a random amount of \"An expression is too long or complex to compile\" in the Error List window. However, the

相关标签:
10条回答
  • 2020-12-11 16:27

    I got this problem today. Somehow I got a really long string in my index.cshtml file. So check for long strings that can cause this problem.

    0 讨论(0)
  • 2020-12-11 16:34

    If cleaning and rebuilding works, it's obviously not a problem with your code. You should report this to Microsoft, seems like a VS bug.

    0 讨论(0)
  • 2020-12-11 16:34

    i got this error cause of very big svg file. and after google it and some personal experiment i found that the solution for big svg file is:

    @Html.Raw(File.ReadAllText(Server.MapPath("~/image.svg")))
    

    in razor file there is another approach with html partial but unfortunately this trick is not working with big svg file.

    hope this help..

    0 讨论(0)
  • 2020-12-11 16:39

    I got this problem today in visual studio 2019. I got a really long string

    <img height="445" src="data:image/png;base64,iVBORw...
    

    in my file.aspx file. Even long images in vs2019 that can cause this problem.

    0 讨论(0)
提交回复
热议问题