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?
精彩评论