Since you have "poco" in your title I guess that you are using the EF4 POCO Generator T4 Template.
Then yes, you can separate POCO classes and ObjectContext into two different class libraries. The T4 Template is prepared for that scenario since it consists of two different files:
- POCOGenerator.Context.tt -> responsible to create your derived ObjectContext
- POCOGenerator.tt -> responsible to create your POCO entities
If you add the POCO generator in the class library where you have your EDMX file, by default both tt-files will be added there.
But you can move then the second file (POCOGenerator.tt) into another class library. (The EDMX project where the context is located needs to reference this library to recognize the POCO classes.) After that open this file in a text editor. Some of the first lines in this file will look like:
...
string inputFile = @"MyModel.edmx";
EdmItemCollection ItemCollection = loader.CreateEdmItemCollection(inputFile);
...
You now need to change the path to the edmx file (only in POCOGenerator.tt, leave POCOGenerator.Context.tt unchanged). Assuming you have edmx project and POCO project in the same solution of Visual Studio, the new path might be:
...
string inputFile = @"..\..\MyEDMXProject\MyModel.edmx";
EdmItemCollection ItemCollection = loader.CreateEdmItemCollection(inputFile);
...
Now you can execute both files separately from two different projects. One will create the context file and the other will create your POCO files.