Last post Oct 11, 2011 03:23 PM by ddelella
Sep 01, 2011 04:28 PM|gil.tankus|LINK
This is the first time i publish a web site on a server so i would appreciate if your answers will be as simple as possible.
I am using Visual studio 2010.
The server is IIS 7.
I copied all the files to the server with the built in ftp client of Visual Studio. (App_Code, App_Data, JS directory and other aspx and aspx.cs files)
I dont know if its relevent or not but i added some dll files to my project (im using fluent NHibernate)
When i navigate to a page wich uses objects that i defined (in the App_Code) i get this compilation error.
CS0400: The type or namespace name 'ContentType' could not be found in the global namespace (are you missing an assembly reference?)
"ContentType" is a enum that i defined.
in my local machine everything is ok and runs perfectly.
Why is this happening?
Sep 01, 2011 04:35 PM|ddelella|LINK
To properly publish a website to a server you should use the built in Publish feature, which compiles the server side code (.vb or .cs files) and copies only the aspx, ascx, etc files to the server. The other option is the Copy Web Site function which copies
all files including the necessary dlls and compiled classes. These are the best two ways to publish a site to a server. The first mention will only work if the server has Front Page 2002 extensions installed. My guess is you are missing the proper file
structure to locate the dlls for your classes and other objects. Try one of the two methods I listed and it should fix the problem.
Sep 02, 2011 01:20 AM|gil.tankus|LINK
I used the copy web site function that you mentioned. All of my source code and dll files where copied to the server.
Maybe they are not compiled? thats the only explenation i can think of.
My file and folder structure is exactly like on my local machine.
i uploaded all of my files and folder (in the same structure) to [MY_SERVER_IP]/httpdocs/demo.
maybe im copying them to the worng place?
Oct 11, 2011 03:23 PM|ddelella|LINK
Does your website run locally? All your class files need to be in the App_Code directory, including Enums. Be sure to build the project locally before copying or it might not copy the latest dll. Make sure you are running the right ASP.NET version on
the server. Make sure the directory has the proper access rights.