Tutorial :ASPX..Renamed a library..now error



Question:

One of my websites references a library in my solution called "Foo" That project generates a file called "Foo.dll" and the classes in it are in a namespace called "MyCompany.Foo"

so far everything worked out...well I right clicked on project "Foo" and changed the filename it outputs to to be "MyCompany.Foo"....now the project generates a file "MyCompany.Foo.dll" everything still compiles ok but when I try to access my site it says it can't find the reference or file "Foo"

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load file or assembly 'Foo' or one of its dependencies. The system cannot find the file specified.


Solution:1

Nevermind it was my own stupidity.

In my web.config, I had a reference to Foo that I needed to change to MyCompany.Foo

I did a global search for Foo.dll...but in this case the assembly was referenced w/o the dll on the end


Solution:2

It could be a number of things.

Open visual studio and your solution file. Then type ctrl+f and search for Foo.dll in ALL solution. Replace any occurences of Foo.dll with MyCompany.Foo.dll

hope this helps.

edit: In case you changed the namespaces in foo.dll from namespace foo to namespace MyCompany.Foo then you might need to make additional changes but i guess you won't need.

Also, make sure that in your ASP.NET project, the reference entry has Copy Local property set to True.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »