User strings used by the program exceeds allowed limit by visual studio 2019

安稳与你 提交于 2021-01-29 07:50:17

问题


I have been working with RazorGenerator.Mvc and RazorGenerator.MSBuild to precompile the views. The error i face when i try to build the project.

CS8103 C# Combined length of user strings used by the program exceeds allowed limit. Try to decrease use of string literals.

Visual Studio 2019 Version 16.3

When i remove RazorGenerator packages, clean and rebuild, the error is gone.

This github issue indicated that the fix will be in VS 2019. I tried everything to debug the issue but could not found it.

UPDATE

When i exclude some of views from the project and try rebuild, error gone. I think it might be the Visual Studio 2019 bug which they say is resolved but isn't.


Any work around that might work? I haven't yet registered view engine.

There might be fix regarding RazorGenerator tool if not for vs2019, if anyone can help or reference, i will be thankful.

Thanks for your time.


回答1:


I end up generating .cs for all my views manually. By setting property CustomTool for all views to RazorGenerator. That was it to work around for me.



来源:https://stackoverflow.com/questions/58555103/user-strings-used-by-the-program-exceeds-allowed-limit-by-visual-studio-2019

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!