1

I have an app that our offshore developers are trying to update. The code built with no issues a year ago. Now when they checkout the code and try to build it they get a reference error in Global.asax:

Error   1   The type or namespace name 'HartSourceLib' could not be   found (are you missing a using directive or an assembly reference?)   c:\Users\rs02130\Desktop\bip\BIProductionSupport\Global.asax    24  9   BIProductionSupport

There is a reference in the Project References pointing to the HartSourceLib DLL. The DLL is present in the referenced location and is the same DLL used in the original build. I'm not familiar with the use of external references in Global.asax. We've tried Using, <% Assembly %> and <% Import NameSpace %> and none have resolved the problem. Here's a sample of Global.asax:

enter image description here

Are we missing something in Global.asax? If not what could be causing the reference issue?

Notes: They're using VS2010 and the 3.5 Framework. I converted the Solution to VS2012 and the 4.5 Framework. Neither works.

Richard Schaefer
  • 525
  • 3
  • 13
  • 45

1 Answers1

2

Make sure the namespace is correct.

then Add

<%@ Import Namespace="HartSourceLib" %> at the start of the code below the 
<%@ Application Language="C#" %>

After that, make sure HartSourceLib exist in web.config file, then mark HartSourceLib file to be copied to output folder on the file properties.

Finally clean your project and build.

I hope that solve your issue.

DeJaVo
  • 3,091
  • 2
  • 17
  • 32
  • Someone in our shop eventually figured this out but it was after I left for the day so I couldn't update the entry. The odd thing is that it built successfully for years (literally) and for the last two years in VS2010/.Net 3.5. Suddenly we had to add the Import Namespace statement. Odd. But fixed. Thanks. – Richard Schaefer May 06 '15 at 11:00