开发者

How to correctly refactor a control's namespace in ASP.NET

开发者 https://www.devze.com 2023-01-03 08:40 出处:网络
I have this situation which is rather frustrating... I have some user controls where I would like 开发者_如何学Goto rename their namespace.However, when I do this my build fails because the .designer.

I have this situation which is rather frustrating... I have some user controls where I would like 开发者_如何学Goto rename their namespace. However, when I do this my build fails because the .designer.cs file for pages that use the controls is still generating control declarations with the OLD namespace. Is this coming from the assembly? I can't rebuild because this is obviously creating a compile-time error (those controls no longer exist in the old name). I've tried wiping out the entire file, but it is always regenerated with the old namespace.

How do I get around this without manually editing every .designer.cs file???


In the past I have used these steps with some success, but I've also had to monkey around a lot, so I maybe missing some steps. (its been a while since I had to deal with this issue)

  1. Close Visual Studio
  2. Delete all designer.cs files (backup just in case ;))
  3. Fire up Visual Studio again and try a rebuild
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号