The type or namespace name '----' could not be found

The type or namespace name '----' could not be found

Old forum URL: forums.lhotka.net/forums/t/8500.aspx


Jav posted on Tuesday, February 09, 2010

I needed to split one of my Csla based Projects into two because one group of objects appeared out of place in there.  I have set the Assembly Name and the Default Namespace name of the second set of projects (Server and Client) to exactly the same ('FrameLibrary') as the original projects. But the code in my Web project continues to generate an error that the object that I have moved into the new projects cannot be found.

I have the new projects referenced in the Web project.  When I click on that reference, the Properties of the reference show that it is in the FrameLibrary.  I have cleaned the solution and rebuilt it (many times), but the error persists.

Any ideas what I can do next.  I would hate to use a blowtorch.  Thanks

Jav

dlambert replied on Tuesday, February 09, 2010

I just ran into this myself w/ an MVC project.  Check the <assemblies> section of your web.config to see if the reference is present there.  If not, try adding it.

Jav replied on Tuesday, February 09, 2010

I do not think <assemblies> will have this assembly since it is my own project, I have never seen those in the <assemblies> of web.config. 

dlambert replied on Tuesday, February 09, 2010

Sorry - I read right over the part about it being a project reference.  You probably already verified that the assembly is being written into the bin folder, right?

Jav replied on Tuesday, February 09, 2010

Both projects' bin folders have a FrameLibrary.dll.   Looking in the Object Browser, I see that each FrameLibrary has only the objects that are in its project.  That seems to make sense.  In the Web project where the objects from both FrameLibrary projects are referenced, only one project's objects are recognized, even though both projects are in the References folder, and the FrameLibrary is in the using statement.

I am probably not understanding it right.  I thought one could place multiple pojects' output in a single library using the AssemblyName in Properties windows.  And since both projects are referenced in the Web project, the object references will be resolved.  But my expectations may be wrong.

Jav

dlambert replied on Tuesday, February 09, 2010

If I understand correctly, you're trying to combine the output of both projects into a single assembly (dll) - if I'm reading this right, I believe that could be the problem.  You can have two projects share a namespace, but each is going to have to have its own assembly name, and when you build your Web project, you should see both dll's in the bin folder.

I think you can combine assemblies with ILMerge, but I don't think the IDE is going to do this for you as part of a "normal" build, and it's probably more trouble than it's worth in most cases.

Jav replied on Tuesday, February 09, 2010

Thanks for affirming - I should have known that in the first place.

Jav

Copyright (c) Marimer LLC