Answered Assembly Reference

Kiran kari

Member
Joined
Jul 29, 2020
Messages
14
Programming Experience
5-10
The type products is defined in an assembly that is not referenced.You must add a reference in an assembly "CETEL.STMS.Data", version =1.0.0.0, Culture = neutral, PublicKeyToken = null.

How to fix the above issue
 
What location in your program was the reference added from?

Right click your project and click add references, you can check your recently added references, and it will tell you the path. You should add your references to your bin folder of your project and then add the references to your project from the bin folder. When you then publish your project, your DLL's will be in your bin folder.
 
You can't just add the dlls again from the bin folder. Where ever you added the references from, you need to remove them and then add them once you copy them into the bin folder. Re-adding references doesn't overwrite the ones that are missing.

@Skydiver any thoughts here?

@Kiran kari where do you get the error? At debug, or at the deployment location?
 
@Sheepings : I removed the already added references in the solution and copied the references to bin folder. And now added the references again to the solution. Still getting error.

Please correct me if am wrong in process.
 
How many projects are in your solution?

Is one of your projects in your solution a library by any chance?

If so, try right click them and build them before building your main project which these other libraries depend on. Then build your main project.

Also check that your project(s) is targeted to use the correct framework versions.
 
And all the projects have strong name values to create assemblies. Even this dll's are also added as strong name values. If I remove strong name values for this 5 projects, i am not getting any errors
 
Right click your solution => Properties => Project Dependencies => Select your main project into the project dropdown combobox. Then tick which projects are dependent on that master project in the combobox. Click apply and Ok. Try build your solution.
 
Main project is added in the dropdown combobox. For remaining 4 projects, i am able to tick for only two projects, remaining 2 projects when checked i am getting popup as "This dependency cannot be added because it will create a circular dependency".
 
You can read up on how to fix that here :

You're about to learn a great deal as you go down the rabbit hole. :)
 
The type products is defined in an assembly that is not referenced.You must add a reference in an assembly "CETEL.STMS.Data", version =1.0.0.0, Culture = neutral, PublicKeyToken = null.
If all the assemblies are strong named, that error there should not have said "PublicKeyToken = null". Which then leads to the question of: how was the first reference created? It really sounds like you painted yourself into a corner with your use of a circular dependency.
 
Back
Top Bottom