You have to have a cad session open, and .net api is always run from within that session.
The C++ people can use "realdwg" to do this outside of a session, but you said .net, so....
You will be doing something like this to get the database object of a dwg:
try {
using (AcDb.Database db = new AcDb.Database(false, true)) {
db.ReadDwgFile(origDwg, FileOpenMode.OpenForReadAndAllShare, true, null); //FileOpenMode.OpenForReadAndAllShare
....
then things like this to dig through that db for info, in my case app id count:
try {
Transaction tr = db.TransactionManager.StartTransaction();
using (tr) {
//get app id count
RegAppTable regapptbl = (RegAppTable)tr.GetObject(db.RegAppTableId, OpenMode.ForRead);
int count = 0;
foreach (ObjectId id in regapptbl) { ++count; }
ParentInfo.ParAppIDCount = count;
you need to look up how to access layer info, as it will involve a different object than a regapptable, but the idea is the same.
Hopefully this gets you started, but the code you want is already on this forum, just look a bit more.
internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties