.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Melody Anderson
Post New Web Links

Sharing class files across projects

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :ASP.Net

Using ASP.NET v3.5 / VS2008.

Is there a way to share class files across web site projects without actually making a physical copy of the file to the App_Code folder of each project?




View Complete Post

More Related Resource Links

Zip Your Data: Using the Zip Classes in the J# Class Libraries to Compress Files and Data with C#


Zip compression lets you save space and network bandwidth when storing files or sending them over the wire. In addition, you don't lose the directory structure of folders you Zip, which makes it a pretty useful compression scheme. The C# language doesn't have any classes that let you manipulate Zip files, but since .NET-targeted languages can share class implementations, and J# exposes classes in the java.util.zip namespace, you can get to those classes in your C# code. This article explains how to use the Microsoft J# class libraries to create an application in C# that compresses and decompresses Zip files. It also shows other unique parts of the J# runtime you can use from any .NET-compliant language to save some coding.

Ianier Munoz

MSDN Magazine June 2003

class files

What is the recommended method of writing and storing class files in VS 2008, I'm using a web application?Many thanks

Sharing of Non-Static member variables of a class using .NET Remoting

This kind of weird. I am trying to host an object of a class X (a class library class). This is a SAO and I have set the WellKnownMode as Singleton in the server configuration. <wellknown mode="Singleton" When multiple clients fetch the instance of the class X they can share the static member variables. Any changes made to the static variables are visible to each other. The problem is with the non-static member variables of the class. Each instance is having a local copy of the non-static variables. Why should that happen in case of a Singleton mode? Am I missing something for which this is happening? Any help will be appreciated.  A for apple, B for boy, C for c++

sub projects(class library) coding too slow

Hi Everyone,I have web project and and 3 reference project working as sub project(class library) of that web app.when I do coding in the sub projects, VS2008 delays, even If I want to copy paste a line 10 times sequentially.between each paste, VS taking a breath like 10 secs. Is there anyone having same problem?I googled it and installed some hotfixes but none helped really. btw, this delay or slow coding doesnt occur foraspx.vb classes (main web project but only for class library) please advise,thanks.

Problem with class files


using vs2010

I created an empty web site project and I'd like to use my own DAL to interact with a SQL Database. 

My class file looks like the following:

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

namespace BatiksGalore
  public class Calendar
  public SqlDataReader GetEventsByDate (string date)


I don't know why but the IDE won't let me construct methods this way. There's a squiggly line under 'SqlDataReader' and the error is 'Expected class, delegate, enum, struct, ...etc.'

I've done this before on Web Site projects and it works fine. Normally intellisense allows me to choose 'SqlDataReader' but in this project (which I've never used before, BTW) I don't have the option.

Any help is appreciated.

Sharing Settings Between Projects in Visual Studio



This isn't exactly an ASP question, but this is the best Visual Studio forum I could find, so here goes...

I'm trying to share settings between two projects: a console app and a WPF app.  The WPF app only exists to view and change those settings. 

So in my console app, I wrote the following class...

Public MustInherit Class Settings

    Public Shared Property masUserID As String

            Return My.Settings.MasUserID
        End Get
        Set(ByVal value As String)
            My.Settings.MasUserID = value
        End Set

    End Property

    Public Shared Property masPassword As String

            Return My.Settings.MasPassword
        End Get
        Set(ByVal value As String)
            My.Settings.MasPassword = value
        End Set

    End Property

    Public Shared Property pathToXmlDocFolder As String
            Return My.Settings.PathToXMLDocFolder
        End Get
        Set(ByVal value As String)
            My.Settings.PathToXMLDocFolder = value
        End Set
    End Property

End Class

 My WPF app has a reference to the console application, so it can access the members of this Settings class.

So you'

WPF Solution with multiple projects sharing same MainWindow



I'm new to WPF and would like to have two executable programs which are almost the same except that some functionality is left out in the second. I think I should use one solution with two projects:

  Project2 (subset of Project1)

To keep it simple, my idea is that Project1 and Project2 have the same sources. I want to inherit the System.Windows.Application and use the same MyApp ancestor with a dependency property (via a view model) to handle the small differences between the two programs. These differences will be:
- Different application names and some other trivial information;
- I will hide some menu items in the subset application.

My question is if it possible to use the same MainWindow (all other sources must also be shared) in both projects. I already spent some hours in the forums and experimented to get it done but did not yet succeed. Can someone give a hint to put me on the right track?

Extra info: I use VS2010 and C#.

Best regards,

Clean Web.Config Files (VS 2010 and .NET 4.0 Series)

.NET 4 includes a new version of the CLR, and a new .NET 4 specific machine.config file (which is installed side-by-side with the one used by .NET 2, .NET 3 and .NET 3.5).

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we've added over the years, including the functionality for:

.ASP.NET Dynamic Data
.ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC)
.ASP.NET Chart Control (which now ships built-into ASP.NET V4)
What this means is that when you create a new "Empty ASP.NET application" project in VS 2010, you'll find that the new default application-level web.config file is now clean and simple:

Class Diagrams

Class diagrams show the static structure of the systems. Classes define the properties of the objects which belong to them. These include:

Attributes - (second container) the data properties of the classes including type, default value and constraints.

Creating a Simple Class in C#

The second article in the C# Object-Oriented Programming tutorial describes how classes are created in C# and how behaviour, in the form of publicly visible and private, hidden methods can be added. This demonstrates some of the uses of encapsulation

Static Class for Beginners

In general, the members of a class can be accessed by instance of that class when they are in public, but there comes a situation to access or call members of a class without an instance and this can be achieved by declaring them as static

How to get more information about the exceptions that can happen in SharePoint 2010 projects?

In case there is an exception anywhere in the SharePoint 2010 project (most common place an exception would happen is during deployment of your SharePoint project, custom deployment configuration or custom deployment steps), there's a registry key EnableDiagnostics available for you to use.

SharePoint document migration challenges when migrating files and folders

There are several challenges when migrating documents to Microsoft SharePoint. While these challenges can be overcome, they are a real pain if the migration source, content and file systems are not SharePoint friendly.

Combine, minify and compress JavaScript files to load ASP.NET pages faster

Websites are getting more interactive these days and most of this interactivity comes from JavaScript. People are using different JavaScript libraries and frameworks to make their websites more interactive and user friendly.

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

PrintPocketCE Print Pocket Excel, Pocket Word and email files

Version 3.560 (May 15, 2009):

Important bug fix: a slight difference in how some devices create fonts was causing a few devices to have significantly longer print times for large print jobs.

Adjusted PocketJet printer paper feed commands

Other minor fixes and enhancements.

Version 3.559 (Mar 5, 2009):

Added support for Martel MCP78xx printers

Version 3.558 (Aug 20, 2008):

Added support for Martel MCP78xx printers

Version 3.557 (June 27, 2008):

Fixed error in Canon printer support

Fixed COM0 port selection

Version 3.556 (June 15, 2008):

Added support for Brother MW-260

Added support for Sato MB400

Version 3.555 (Aug 8, 2007):

Added support for Pentax RuggedJet 3 and RuggedJet 4 printers

Changed Epson TM-P60 support to maximum page width of 1200 dots

Version 3.551 (Aug 1, 2006):

Added Peripheral Nomad printer support

Version 3.550 (Mar 23, 2006):

Added Panasonic JT-H200PR printer support

Added Pocket Spectrum printer support

Fixed problem with WM5.0 "inverted image" problem

Conversion of text files from ANSI to UTF-8

reading and writing text files in ANSI format and
writing html-files in Charset ISO-8859-1 (Western Europe).
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend