你好@雨涵 杨,
我觉得这是个潜在的问题,我注意到开发者论坛上已经有人提出一样的问题了=> VB.NET Project Properties display an error when adding a new element to the project。
上面这个帖子提到了两个问题,一个就是你遇到的"The custom tool 'MyApplicationCodeGenerator' failed."报错,发生在.NET Framework项目中,更改启动窗体的时候。另一个是关于在.NET VB Winform项目中无法更改启动窗体的问题。
你可以跟踪我上面分享的开发者论坛的帖子,一旦产品组有新的消息,你会被第一时间通知。
另外,我感觉这个问题影响的东西还挺多的,可能造成无法关闭VS,以及没法保存项目文件等一系列报错。你可以暂时试一下下面的方案,然后记得备份下能构建成功的项目,以防万一。
- 点击Solution Explorer中的Show All Files按钮,展开My Project,单机Application.myapp,把<MainForm>Form1</MainForm>改成你想要设置的先启动的窗体比如<MainForm>Form2</MainForm>,点击保存。
- 右击项目,Unload Project,再次右击项目,Reload Project。
- 打开项目属性页,设置Startup Object为新的窗体,保存并运行项目。
诚挚的问候,
Tianyu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.