all groups > visual studio .net general > january 2006 >
You're in the

visual studio .net general

group:

Gets confused with references


Gets confused with references David Thielen
1/31/2006 3:00:19 PM
visual studio .net general:
Hi;

I have a solution for a Word Add-In. It has 3 C# projects where two of them
have all of the files of the 3rd as links. This is done because Word wants
the Add-In linked to the COM libs for the version running, so we have the
same set of source linked 3 times.

We have two DLLs that we build that are used by the Add-In. When we have a
new version of the DLLs, I copy them to a single directory which all three
projects point to as references. The properties for the references show the
correct location of the DLLs and show the new version number of the DLLs.

When I go to build again, the project that has the files builds fine. But
the two projects that have a link to for all the files gives me the following
error:
C:\src\wr\AutoTag\AutoTag2003\Framework.cs(27,11): error CS0246: The type or
namespace name 'net' could not be found (are you missing a using directive or
an as
sembly reference?)

net.windward.* is the namespace for the DLLs. So why can it not see the
namespace of the DLLs referenced once I copy new ones over? And why only for
the projects that bring in all files with a link?

--
RE: Gets confused with references yhhuang NO[at]SPAM online.microsoft.com
2/1/2006 12:00:00 AM
Hello Dave,

Currently we are looking for somebody who is familar with it and will reply
you with more information here as soon as possible. If you have any more
information, please don't hesitate to add it here.

Thanks for your patience.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://msdn.microsoft.com/subscriptions/managednewsgroups/

This posting is provided "AS IS" with no warranties, and confers no rights.
RE: Gets confused with references v-phuang NO[at]SPAM online.microsoft.com (
2/2/2006 3:40:55 AM
Hi Dave,

I did not understand your question very well.
Commonly the Reference in the IDE is working based on the Assembly not on
the source file level(.cs file).
So I understand that you have three projects which will product three
assembly.
One of them is the Addin dll, which will reference to the others.

When you have changed one of the assembly's source and rebuild, and then
copy the assembly to the Addin directory. You will receive the error below
when you rebuild the addin.
C:\src\wr\AutoTag\AutoTag2003\Framework.cs(27,11): error CS0246: The type
or
namespace name 'net' could not be found (are you missing a using directive
or
an as
sembly reference?)

If I have any misunderstanding ,please feel free to post here.

From the error message, it seems that certain type can not be found, that
maybe caused by the dll is missing, or the type is not in the dll again.
You have a check.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
RE: Gets confused with references David Thielen
2/2/2006 8:35:33 AM
Hi;

Not exactly.

I have three projects and these three projects create AutoTag2000.dll,
AutoTag2002.dll, and AutoTag2003.dll. All of the source files for the three
add-ins are the same files.

The source files are all in the AutoTag2003 project. For the AutoTag2000 and
AutoTag2002 projects, I added the files in the AutoTag2003 project to them.
In these two projects I would do "Add", "Existing Item", select the file, and
then instead of clicking on "Add" I would click on "Add as Link".

So this gives me three projects using the same files. And that part works
fine.

For the references, each project has the three Office Add-In DLLs that are
for it's version of Office. They also have all of the other references (DLLs)
that all three need. These common references range from System.Data to
WindwardReportsAPI.dll and WindwardReports.dll (our reporting engine).

The files WindwardReportsAPI.dll and WindwardReports.dll are in a directory
(lib) of the solution that is not a subdirectory of any of the three projects
(it is a peer of them). These references are added to all three projects
using browse and pointing to the dll files in the lib directory.

When we build a new version of the reporting engine, I copy those dll files
to the lib directory. Once they are copied, I can build AutoTag2003 again
fine. But if I try to build AutoTag2000 or AutoTag2002 again, it cannot
compile any files that call classes in WindwardReportsAPI.dll and says it
cannot find the namespace "net". All of the classes in WindwardReportsAPI.dll
start with net.windward.*

If I remove and re-add the references to WindwardReportsAPI.dll and
WindwardReports.dll, then it builds fine. Since AutoTag2003 builds fine with
no changes, clearly the new version of the files are there ok.

So, what is the problem and how can I fix this?

RE: Gets confused with references v-phuang NO[at]SPAM online.microsoft.com (
2/3/2006 12:00:00 AM
Hi

Based on my test,I can not reproduce the problem.
So far here a few steps you may have a try.
1. Try to add reference to the project not the dll
2. Try to create a solution, create new projects and copy/paste the source
code to see if that helps.
3. Try to create a three solutions. each for one project to see if that
helps?



Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button