在VS2017中添加的新页面没有与其对应的代码后台和设计师页面链接。
在VS2017中添加的新页面没有与其对应的代码后台和设计师页面链接。
我在VS2017中添加的任何新页面都无法与其对应的代码后台或设计页面进行关联:
- 在所有项目和解决方案中都发生
- 右键单击aspx代码时,上下文菜单中没有显示“查看代码”(在现有页面中有效)
- 在解决方案资源管理器中右键单击.aspx,显示“查看代码”选项并按预期打开后台代码
- 在设计师和导航菜单中不会自动添加控件引用(更改了autoeventwireup)
- 页面声明中的智能感知只显示一个选项("db"),而通常应显示15或20个选项 - 新页面和现有页面
- 编译通过
- 我可以直接在设计页面中添加引用,并能够在代码后台中引用它
- 编辑:所有控件的智能感知也只显示“db”
在VS2015中没有这个问题。我两个版本都安装了,并在2015中打开了一个解决方案,上述问题不存在。
解决方法是清除我的临时ASP.net文件,根据Kenan Deen在这篇文章中的回答:
1. Close Visual Studio 2017.
2. Open the Windows File Explorer and navigate to the temporary ASP.net files directory. The default location is "C:\Windows\Microsoft.NET\Framework\v(version number)\Temporary ASP.NET Files".
3. Delete all the files and folders within the Temporary ASP.NET Files directory.
4. Restart Visual Studio 2017.
This should resolve the issue and allow the newly added pages in VS2017 to link to their respective codebehind and designer pages.