4

Basically, after read a couple links, i tried the above code:

foreach (EnvDTE.Project proj in soln.Projects)
        {
            if (proj.Name == "BLL")
            {
                VSLangProj.VSProject vsproj = (VSLangProj.VSProject)proj.Object;                    
                vsproj.References.Add(@"C:\Teste\DAL\bin\Debug\DAL.dll");                    
            }
        }

All paths, project names, are hard-coded on purpouse, since im still testing how to achieve it.

Though it would act like if i did Project folder -> References -> Add reference -> Pick one, manually (compile time)

but after loading the solution, BLL project didnt contain any PERMANENT reference to DAL project.

1 Answer 1

1

I think that you forget to save modified project , you have to invoke Save at the end

Sign up to request clarification or add additional context in comments.

1 Comment

user592 or whatever your name is, you were right. I had to save the project, but i though you were talking about save the SOLUTION. Worked like a charm. Thanks :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.