Error

  • Thread starter Thread starter esha
  • Start date Start date
E

esha

I created WEB app in C# and it runs fine on my local machine. When I moved
everything to the hosting server I've got an error:
Compiler Error Message: CS0246: The type or namespace name 'Photo' could not
be found (are you missing a using directive or an assembly reference?)

Source Error:
Line 186: public static List<Photo> GetPhotos(int AlbumID)

I have public class Photo in the project.
If the application runs on my local machine without any reference then why
and how should I reference it when it runs on the server?

Thank you

Esha
 
Hi,

I don't quite understand the error, that is a compile time error, you should
be moving the executables to th eserver, no the source code to compile it.
 
After you copile find the bin folder it put your files in. Make sure all the
dll's in there are going on to your server.

The reason you are gtting that error is one of your dll's is not on the
server but it is on your local machine. If the dll is missing then a codefil
within it is missing, and so missing namespace.
 
I'm sorry to tell that I'm a very very beginner and maybe this is stuppid
think, but when I created this WEB application and compiled it I did not see
any bin directory in the application folder. Before I did some simple
development in Windows Forms and I really saw that directory and I know that
there is compiled files.
With C# WEB application after I build it I do not see any compiled files. So
I decided that C# works some different way and doesn't create any dll.
One more think made me to think that way - when I created this application
from the template (Personal WEB Site startert kit) and moved all files
(there were no dll's for sure) to the hosting server, application started to
work without any problem. I tested it on my development machine as well as
on a couple of other machines not related to my project or even Framework or
Visual Studio.
Then I made some changes. On local machine it works fine, but on hosting
server it produces the error I described in my initial post.
In both cases (on local machine and on the server) I use the same database
(Connection String is not changed), so even when I run the application on my
local machine it uses the database from hosting server.

Thank you
Esha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top