使用 EnvDTE 项目时 RPC 服务器不可用
首先:这是一个离线应用程序。 操作系统:Windows 7 Professional N x64
事实:它是一个代码生成器。在解决方案内创建和引用项目后,我必须写出所有类(基于我从数据库中读取的内容)以生成 DTO(目前)层(仍在构建 DAL/BLL 部分)。
在我的工作中,它运行良好,完全没有问题,我可以使用 Win 7 32 位进行编译和调试。
好吧,但是当我今天回到家(项目继续我的工作)并尝试在这里调试它时,发生的情况是:
这段代码
myProj.ProjectItems.AddFromFileCopy(fPath);
myProj.Save(project.FullPath + "\\" + project.ProjectName+ ".csproj");
是当前项目,位于创建的解决方案中,并负责添加下一个最近为项目创建的类(位于 foreach 循环内)。
但突然间,在添加了随机数量的类后,它抛出一个异常,说
The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
我完全迷失了。 myProj 是一个 EnvDTE.Project 变量,它自己的值永远不会改变。它永远是相同的值。
因此,它会随机“崩溃”并抛出该异常。我确实读过一些关于它是 VS 2008/2010 的错误,甚至导致 fPath 总是有一个值(要在项目中添加的文件的路径)
的任何想法,我是否缺少某些东西或什么?
Firstly: This is an OFFLINE application.
OS: Windows 7 Professional N x64
Facts: Its a code generator. And after creating and referencing projects inside solution, i had to write all the classes out (based on what i read from database) to generate a DTO (for now) layer (still building DAL/BLL parts).
On my job it just runs fine, no problems at all, i can compile and debug, using Win 7 32 bits.
Well, but when i came back home today (with the project to resume my work) and tried to debug it here, what happen is:
this piece of code
myProj.ProjectItems.AddFromFileCopy(fPath);
myProj.Save(project.FullPath + "\\" + project.ProjectName+ ".csproj");
is the current prject, inside the created solution, and is responsible for adding the next recently created class to the project (its inside a foreach loop).
But suddenly, after having added a RANDOM number of classes, it throws an exception saying
The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Im totally lost. myProj is an EnvDTE.Project variable, that never has its own value changed. It'll always be the same value.
So, randomly it "crashes" throwing that exception. I did read something about it's a bug of VS 2008/2010, even cause fPath always has a value (the path of the file to be added within the project)
Any ideas, am i missing something or what?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论