Relationship Between Assemblies, Namespaces And Classes?

Apr 13, 2010

I'm trying to understand the relationship between assemblies, namespaces and classes. Can anyone help explain or point me to a usefule link?

1. I understand that an assembly is typicall a dll or an exe (perhaps other files also). Does each project compilation produce only 1 dll? Or is the number of DLL dictated by something completely different?

2. I read each assembly can contain multiple classes. Asingle assembly can contain classes for multiple namespaces, and asingle namespace can span multiple assemblies.

View 5 Replies


Similar Messages:

Need Reference About Namespaces And Classes?

Mar 27, 2010

what are the namespaces that should be well known by a fresher to initiate asp.net learning, what is the main use of a namespace. what is the use of 'args'

View 4 Replies

Classes And Namespaces - Error CS0101 Namespace Already Contains Definition

Nov 29, 2010

I keep getting the error: Error message: CS0101: The namespace '<global namespace>' already contains a definition for 'checkvalue'. Then, I rename the Inherits from the @page directive in both the .aspx and .aspx.cs pages and it works! My website has only 2 pages, and both use the same class (same class name, exactly same syntax) but it has been copied and pasted and the 2 aspx pages (and aspx.cs pages) are not referencing each other. In other words, both aspx.cs pages (called page1.aspx.cs and page2.aspx.cs) has the class

public class CheckValue
{
//content
return true;
}

Both the aspx pages reference the 'inherits' files seperately:

<%@ Page Language="C#" CodeFile="page1.aspx.cs" Inherits="_1" %>

and my code behind

public partial class _1 : System.Web.UI.Page

and for my second page

<%@ Page Language="C#" CodeFile="page2.aspx.cs" Inherits="_2" %>

and my code behind

public partial class _2 : System.Web.UI.Page

I don't use the .resx file. Why does this error happen some times, and not other times?

View 5 Replies

DataSource Controls :: Extending LINQ Classes With Different Namespaces?

Apr 6, 2010

Is there anyway I can extend LINQ classes through different namespaces?Typically in my class libraries I have a namespace for each class object and their associated DAO and service classes in a folder of my project, therefore on the front-end I can only use the namespaces associated with the given page and not clutter my intellisense or load in a bunch of excess stuff.

However, I have found that upon adding my .dbml LINQtoSQL file, whatever namespace that is in, whether it's the project root namespace or a custom one, is the only namespace I can use partial class extension in.I have tried even creating a custom workspace (placing the .dbml file in a folder) and then including a using statement to that namespace and I still cannot extend the partial classes.Is there anyway I can do this? Or to have the .dbml file count as being in every namespace? I don't want to remove all namespaces but the root one either.such when I try doing the partial class from a different namespace I get the following error:

Error 1
'Id' is not a member of 'LCFVB.EntityNS.Entity'.
C:Usersshol726.UILAWDocumentsVisual Studio 2008ProjectsLCFVBEntityNSEntity.vb
10 7
LCFVB

View 7 Replies

Configuration :: What Is The Diff Between Link To Assemblies In Project File And Assemblies In Web.config File

Apr 30, 2010

when I reference a assembly. It's reference gets added to the project file in my case ( ABC.csproj)

Also when I take a look at the web.config file there is a section called <assemblies>. And lot of assemblies are added there.

What is the difference between link to the assemblies in the Project file and the assemblies in the web.config file?

View 1 Replies

Visual Studio :: What Is The Difference Between Designer Classes And T4 Template Generated Classes

Jan 11, 2010

I am new to LINQ. when we drag tables we get a dbml file and designer file.

For example DataClasses1.dbml and DataClasses1.designer.cs.

Once we have them then we can start using our LINQ Queries.

In my company project I do not see this designer files and instead there are .tt files which were used as templates to greate ABC.generated.cs files. Is this same as designer class?

View 3 Replies

C# - Class Structure With LINQ, Partial Classes, And Abstract Classes

May 17, 2010

I am following the Nerd Dinner tutorial as I'm learning ASP.NET MVC, and I am currently on Step 3: Building the Model. One part of this section discusses how to integrate validation and business rule logic with the model classes. All this makes perfect sense. However, in the case of this source code, the author only validates one class: Dinner.

What I am wondering is, say I have multiple classes that need validation (Dinner, Guest, etc). It doesn't seem smart to me to repeatedly write these two methods in the partial class:

[code]....

This doesn't "feel" right, but I wanted to check with SO to get opinions of individuals smarter than me on this. I also tested it out, and it seems that the partial keyword on the OnValidate method is causing problems (understandably so). This doesn't seem possible to fix (but I could very well be wrong).

View 1 Replies

C# - Can Base Classes See The Protected Fields Of Derived Classes

Aug 11, 2010

I don't know if this has to do with how FindControl works or how scope works. But my base class is having a hard time seeing the fields of child classes. Currently I'm planning have the derived class set a property in the base class, but there are a lot of derived classes, so that isn't a very attractive solution.

[code]....

View 4 Replies

Web Forms :: Using C# Classes Vb Classes Together In VS2008 / 3.5 Project

Mar 24, 2010

Can I use VB and C# classes together in the same asp.net 3.5 project?

View 3 Replies

Map Model Classes To ViewModel Classes Or Aggregate Model Classes In ViewModel Classes

Dec 15, 2010

I'm curious as to what people consider better practice, between duplicating model structure in the view model and using a mapping tool to move data between the two, or aggregate the model inside the view model, i.e. have a property on the view model class that is a reference to the actual model. Which is considered a better approach in general?

View 1 Replies

Using Namespaces Once In The Master?

Jul 21, 2010

I'm using nested master pages for my site, is there a way I can use the namespaces once in the master?Currently I have to add the namespaces to whichever page I need them in.

View 1 Replies

Web.config Namespaces Not Being Read?

Feb 2, 2011

I have a web site that was done in asp.net 2.0 along with visual studio 2005. I've recently upgraded to VS 2008 and I'm haveing an issue with the namespaces in the web.config file not registering. Specifically, references to system.web and microsoft.visualbasic.

View 3 Replies

MVC :: Using Namespaces In Razor Views?

Jan 18, 2011

I've recently switched over to using the Razor view engine, and I want to specify a namespace to use in a view. I've tried adding an entry to the Web.config file, ie:

[Code]....

But none of my views recognise any of the classes inside that namespace, so I have to declare the namespace in every view that needs it. why the Web.config approach isn't working?

View 13 Replies

MVC :: What Is MapRoute Namespaces Parameter

May 19, 2010

ASP.NET MVC's MapRoute method has a parameter named namespaces. From looking in the code, I see that this parameter is saved in the Route object

in DataTokens["Namespaces"].

It seems to me that it has some meaning... anyone knows what is it for?

View 2 Replies

C# - How To Add Default Namespaces To Web Config

Jul 13, 2010

I read an article here to find the solution to my problem. But I found that it is not working for me. Whenever I tries to use any function I have to add same namespace on every page. by doing using System.Web.UI . Can I also use it for namespace that is being created along with an application. i.e. Library is an another namespace that lies in App_Code folder not as an assembly.

[code]......

Is there any way to get them available at Code Behind Page

View 1 Replies

Folders Without Namespaces C#, .Net, VS 2008?

Apr 19, 2010

I'm working on an ASP.NET webapp using the MVP pattern, and as I'm organizing my files I'm wondering - are there conventions on folders within projects and how they relate to namespaces?

I have a bunch of controls and a bunch of pages, and I was going to throw them into Controls and Pages folders with subfolders, but I didn't know if it was bad form to do this if I wasn't also going to seperate them out into namespaces.

View 1 Replies

C# - Matching .NET References To Namespaces?

Apr 8, 2010

im creating a class library, and adding all the necessary references for the source files contained in it.

Now, off the bat, there were over 300 compiler errors complaining about missing namespaces.
The library will now compile after i just added all of the System.* references, however this is obviously not the best way.

I.e. if a classes needs using System.Web.Script;, there is no System.Web.Script reference, how would i find out which one of these references contained it? System.Web didnt.

View 4 Replies

C# - Adding .NET Namespaces Automatically?

May 26, 2010

I need to add this namespace to my c# file:

using System.Data;

Is there a way to automatically add this to newly created pages in c#.net?

I don't want to add this namespace to new pages.

View 6 Replies

MVC :: How To Respect Namespaces Section In Web.config

Nov 18, 2010

I am referencing some classes in my _layout.cshtml file and I have the namespaces in my Views/web.config <pages><namespaces> section and the layout page does not resolve. If I put @using statements in the layout page, it works fine. Shouldn't the layout page respect the web.config section?

View 5 Replies

Configuration :: How To Define Namespaces In Web.config

Aug 27, 2010

See the page [URL].

Defining namespaces in web.config works fine with VB.NET, but C# is not recognizing the namespaces.

View 2 Replies

Get The Functionality Of Namespaces Inside A Class?

May 1, 2010

I have the following code:

[Code]....

I would like the functionality of namespaces inside of a class, as in something that would let me call Step2.Execute() instead of having to put Step2_ in front of a whole bunch of functions. I don't want to have to create separate classes / modules for step1, step2, etc.

Is there a way that I can accomplish namespace functionality from inside a class?

View 3 Replies

Web Application Project, BLLs And Namespaces?

Jun 8, 2010

We have a large ASP.NET project which has 100s of BLL classes. In our ObjectDataSources in the UI layer we have typename="". Because we are converting to a web application project, the typename has to include the root namespace of the project. This means we have 1000s of changes to make across lots of files.Are there any better options out there to prevent us from having to do this?

View 1 Replies

Adding And Removing XML Namespaces And Nodes

Jan 30, 2013

I am using vs2008 vb code behind. I am currently receiving an object through a web service that I serialize into xml. What I'd like to do after that is remove the namespaces, and add nodes to sort of customize my own xml doc. I am getting an error on this

Code:
Dim DOC1 As New XmlDocument
Dim STR As String
STR = ConvertObjectToXmlString(HODRes).ToString
DOC1.LoadXml(STR)

[Code] ....

The error I get is:

Server Error in '/RateAudit' Application.
________________________________
Data at the root level is invalid. Line 1, position 1.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

Source Error:

Line 109: Dim STR As String
Line 110: STR = ConvertObjectToXmlString(HODRes).ToString
Line 111: DOC1.LoadXml(STR)
Line 112:
Line 113:

View 1 Replies

Visual Studio :: How To Change The Default Namespaces

Aug 7, 2010

When i create a class file .vs add some default using statement like (using System;using System.Collections.Generic;) .But now i expect vs add using System.Configuration by default.

View 2 Replies

MVC :: Creating Solution With Multiple And Sharing Namespaces Across Projects

May 25, 2010

If MVC application has multiple projects (The solution may grow large in future). These projects may share controllers such as application controller accouts controller and there may also be a situation in which namespace of one project is shared by other project. What is the best way of implementing such solution. One approach may be to use areas.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved