1

I am working with a .NET 3.5 class library that was created in Visual Studio 2008, and later updated and recompiled in Visual Studio 2010. The strangest thing is happening: One of the Web References that is listed in the Solution Explorer does not actually compile into the DLL (proven by inspecting the DLL with .NET Reflector), and there are no errors or warnings respectively. I tried Googling and searching this site and I could not find any applicable information. Any advice about why this is occurring will be greatly appreciated! Hopefully the information provided is enough; otherwise I should be able to provide more.

Edit: The namespace for the Web Reference shows up in the Solution Explorer, but not in the Object Browser. Some of my colleagues are saying that this is an issue with the Web service itself. I should mention that it is an SAP Web service and during development we are interfacing with a test environment that was recently upgraded and could be acting problematically. I will confirm whether this is the cause once I am more certain, so please don't hesitate to share any relevant information meanwhile.

Edit (2): See my first response to Cyborgx37's answer for further clarification including the client-side error that is generated.

Community
  • 1
  • 1
Jesse
  • 608
  • 8
  • 19

2 Answers2

1

This is slightly baffling: All I did to get the Web Reference into the Object Browser - and hence into the actual DLL at compile time - was rename it to something else, and then revert it back to its old name (which was optional to keep the name the same). Gotta love strange Microsoft issues. Hopefully this helps someone else who ends up running into the same issue!

Jesse
  • 608
  • 8
  • 19
0

If I understand correctly, you are wondering why the referenced assembly is not compiled into your DLL.

Referenced assemblies are typically not compiled into the DLL. Your DLL will instead contain a pointer to the external resource and .NET will attempt one of several strategies for locating it (and then loading it into memory so your application can use it).

You may find this article enlightening:

How the Runtime Locates Assemblies
To successfully deploy your .NET Framework application, you must understand how the common language runtime locates and binds to the assemblies that make up your application. ...

JDB
  • 25,172
  • 5
  • 72
  • 123
  • There are nearly 40 Web References in the project that I am referring to. After compiling the project, all of the Web References except for one have their own namespace within the resulting DLL's module (as evidenced via .NET Reflector). At runtime, when the Web Reference that is missing its namespace is called, this client-side error generates: "System.TypeLoadException: Could not load type _[type]_ from assembly _[assembly]_." I truly appreciate your prompt and detailed response, but I do not think it answers my question because there is a clear difference with this one Web Reference. – Jesse Dec 26 '12 at 17:47
  • This information would be useful in your question. Unfortunately, I've not run into this issue so there's nothing more I can offer you. – JDB Dec 26 '12 at 17:51
  • I apologize if I was not specific enough. I will figure it out eventually and share my findings. Thanks again! – Jesse Dec 26 '12 at 17:57