The type or namespace name 'Optimization' does not exist in the namespace 'System.Web'

后端 未结 7 641
花落未央
花落未央 2021-02-05 01:32

I am deploying a new website as my main site and it works beautifully.

All of my applications under the root url work as well, except for one. It is a legacy system (c#

7条回答
  •  忘掉有多难
    2021-02-05 02:17

    I was just experiencing: "CS0234 C# The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)" and found this stackoverflow page. -- The cause for me was due to me renaming the web form (aspx page) I was working with, I also wanted to rename the public partial class behind that form. Doing so resulted in the mentioned error code. I added "using System.Web.Optimization;" to the code behind (C#), "cleaned" the solution, then "built" then solution, then "rebuilt" the solution and now the error is gone and that using statement wasn't being used, so I got rid of it. My solution no longer has that or any errors so I figured I'd share this weird story. I probably didn't need to use that "using" statement, but whatever.

提交回复
热议问题