Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I am using a class library in my windows service.
I have added the dll as well as used using derective, but still it is giving me error "The type or namespace name 'SSCommuniLib' could not be found (are you missing a using directive or an assembly reference?)"

I removed and added the dll several times but still it is not working.

It is giving me warning
Warning 1 The referenced assembly "SSCommuniLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". LeadsolarService
Posted
Updated 20-Nov-12 17:02pm
v4
Comments
Timberbird 20-Nov-12 9:54am    
Since it's a service... have you tried putting your assembly to GAC?
ascentit solutions 20-Nov-12 9:57am    
it was working fine earlier but after making some minor changes in class lib it started giving me error
Timberbird 20-Nov-12 10:05am    
When do you receive this message? When you build your project or during runtime?
ascentit solutions 20-Nov-12 10:13am    
during building
Timberbird 20-Nov-12 11:04am    
Well, if you didn't change any namespace/class name and also checked spelling (for example, using Ctrl+F)... have you tried to clean and rebuild the project?

1 solution

You are not adding anything with using directive. You totally misunderstood its purpose. It is only used to change the naming of the types in the code of some namespace. It is not related to assemblies at all, it is only related to namespaces; for example, naming of the types in the code can be shortened, without specifying full names including namespace parts of the names. And one assembly can use different namespaces namespaces, and the same namespace can be used in different assemblies — these things are totally independent.

The central notion of .NET is the assembly. They use each other using referencing of one assembly by another (and also, via Reflection and loading assemblies during runtime or even creating them during runtime using System.Reflection.Emit — let's not consider this at the moment). You can reference assemblies in your project, by using "Add Reference" — see the project tree under Visual Studio Solution Explorer. At the level of compilers, there are appropriate command line parameters for referencing assemblies.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900