Search EggHeadCafe's Job Board
EggHeadCafe Silverlight WPF ASP.NET VB.NET C# Excel SQL Server SharePoint
search
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

WebArticlesForumsFAQs
JavaScript
ASP
ASP.NET
WCF

DatabasesArticlesForumsFAQs
SQL Server
Access
Oracle
MySQL
Other Databases

OfficeArticlesForumsFAQs
Excel
Word
Powerpoint
Outlook
Publisher
Money

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

Operating SysArticlesForumsFAQs
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
Lounge
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  Ask New Question With Power Editor

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

Reply    Reply Using Power Editor
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0
I wouldn't even consider deploying .cs files
Peter Bromberg replied to Kevin R on 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.
Reply    Reply Using Power Editor
Peter Bromberg is a C# MVP, MCP, and .NET expert who has worked in banking, financial and telephony for over 20 years. Pete focuses exclusively on the .NET Platform, and currently develops SOA and other .NET applications for a Fortune 500 clientele. Peter enjoys producing digital photo collage with Maya,playing jazz flute, the beach, and fine wines. You can view Peter's UnBlog and IttyUrl sites.
Please post questions at forums, not via email!
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0

RE: I wouldn't even consider deploying .cs files
Kevin R replied to Peter Bromberg on Friday, October 27, 2006 12:36 PM

How do I go about doing that?

Reply    Reply Using Power Editor
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0

Even .dll didn't help!!
Kevin R replied to Peter Bromberg on 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

Reply    Reply Using Power Editor
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0

use these steps
Rishi Mishra replied to Kevin R on 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.

 

 

Reply    Reply Using Power Editor
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0

RE: Found the problem!
Kevin R provided a rated reply to Rishi Mishra on 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.
Reply    Reply Using Power Editor
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0