search
Japanese Chinese Nederlands Espanol Italiano Deutsch Francais Twitter Rss Feeds
MicrosoftArticlesForumsFAQs
C# .NET
VB.NET
Visual Studio .NET
ADO.NET
Xml / Xslt
VB 6.0
.NET CF
GDI+
LINQ
Deployment
Security
FoxPro
Silverlight / WPF
Entity Framework
RIA Services

Web ProgrammingArticlesForumsFAQs
JavaScript
ASP
ASP.NET
Web Services

Non-MicrosoftArticlesForumsFAQs
NHibernate
Perl
PHP
Ruby
Java
Linux / Unix
Apple
Open Source

DatabasesArticlesForumsFAQs
SQL Server
Access
Oracle
MySQL
Other Databases

OfficeArticlesForumsFAQs
Excel
Word
Powerpoint
Outlook
Publisher
Money

Operating SystemsArticlesForumsFAQs
Windows 7
Windows Server
Windows Vista
Windows XP
Windows Update
MAC
Linux / UNIX

Server PlatformsArticlesForumsFAQs
BizTalk
Site Server
Exhange Server
IIS

Graphic DesignArticlesForumsFAQs
Macromedia Flash
Adobe PhotoShop
Expression Blend
Expression Design
Expression Web

OtherArticlesForumsFAQs
Subversion / CVS
Ask Dr. Dotnetsky
Active Directory
Networking
Uninstall Virus
Job Openings
Product Reviews
Search Engines
Resumes

 

View Other Visual Studio .NET Posts   Ask New Question 
How to include seperate .cs files?
Kevin R posted at Friday, October 27, 2006 12:29 PM

I have an asp.net 2.0 app running on Win2003 server adn I have seperate .cs files that have methods that I call on. When I run the app on my development machine it runs fine, but on the server it doesn't see the seperate .cs files. Anyone know what I can do to fix this?

Compiler Error Message: CS0103: The name 'DataHandler' does not exist in the current context


 
I wouldn't even consider deploying .cs files
Peter Bromberg replied to Kevin R at Friday, October 27, 2006 12:30 PM
Suggest trying the ASP.NET 2.0 Web Application Projects add-in, which compiles all to a single assembly in the /bin folder. Then you don't have to deploy any .cs files because they're all compiled in advance.
 
RE: I wouldn't even consider deploying .cs files
Kevin R replied to Peter Bromberg at Friday, October 27, 2006 12:36 PM

How do I go about doing that?

 
Even .dll didn't help!!
Kevin R replied to Peter Bromberg at Friday, October 27, 2006 3:20 PM

I compiled the seperate .cs code files into a dll and added them as a reference into the project. Built it and it compiled sucessfully. When I ftp'd it up to the server, I still get the same error... CS0103: The name 'DataHandler' does not exist in the current context

 
use these steps
Rishi Mishra replied to Kevin R at Saturday, October 28, 2006 4:39 AM

Use these steps

Step1: Go to the Option Build ->Publish Site

Step2: Select the destination folder and copy that folder to development server

                                             OR

           if you are using FTP then give that path and copy that files to development server.

So that contains All necessary files to run the application not cs files and your application will work fine.

 

 

 
  RE: Found the problem!
Kevin R replied to Rishi Mishra at Monday, October 30, 2006 12:05 PM
On my development machine, the path to the code-behind/pics/etc was in the webs main dir. When I made it on the server, the path was not part of the webs main dir. (Ex: dev mch [C:\Inetpub\wwwroot\webdir\page.aspx] as per server [D:\Inetpub\wwwroot\webdir\main\page.aspx]). So when it was trying to find the code-behind files it was looking in the main dir, not any of the sub-directories. How do you tell it to look for the files in a specific sub-directory is beyond me right now. Im just learning as I go.