How Are Classes Shared Between Projects In The Same Solution

Jan 29, 2011

I'm totally new to the Microsoft dev scene so please go easy :)Currently, I have a solution that contains two projects (ASP.net websites, FWIW). If I create a class in Project1, how do I expose it to Project2? Is it automatically available to Project2 because they are in the same solution? Or do I need to do something special to make the connection?

View 5 Replies


Similar Messages:

Architecture :: Sharing Classes In Between Two Associated Projects In One Solution?

Dec 3, 2010

I am looking for general direction on the best practice here. I have a class that I want to share between two different forms in two projects that are associated. The two forms are in seperate projects but both projects load together as I have added the second project to the first. I also have a class that I want to share between these two projects which will cause me to add another project to this solution with will mean I will have three projects in my solution. My question is how do I best share this class?

I believe the only way to do this is to add the class in the reference in both of the form projects?... Is this correct ? I'd really like to just reference the class and inherit it in the source code without adding it as a reference but I am feeling that I can't do that. I am obviously pressed for time and working on other projects and a I am a experienced coder with only about 1 year of C# experience...

View 4 Replies

Workflow For Adding New Classes To Large Solution With Multiple Projects?

May 11, 2010

I am currently extending the NopCommerce solution for a client and have some general questions about workflow, since this is a relatively large solution for me (50+ projects).

I want to add some classes to the DAL, BLL, and so forth.

What would be the recommended process for this workflow? For example, I created a class in the DAL -> ran build. Then I created a test.aspx page in the main project which instantiates this class -> ran build; however, adding just one line of code causes the solution to rebuild all other projects such as payment modules, which makes the process tedious.

Am I approaching this in the correct manner? I have read about: creating a seperate solution with relevant projects; is this the recommended approach?

View 1 Replies

MVC :: How To Link Two Projects In One Solution

Jan 6, 2011

i have two projects in one solution...

project A

project B

in project A i have page in--->Home/Account(page)

what link i have to use from project B to open the page in project A

View 5 Replies

Multiple Web Projects In One Solution, Config Transforms

Nov 15, 2010

I am attempting to setup Config Transforms on my project that I migrated to VS 2010. The web project works just fine, but I have a WCF Host project that I seem to be unable to add transforms.

Has anyone had this problem before?

View 1 Replies

Storing Resource Files In Different Projects In Same Solution?

Jan 14, 2011

I have a project where I need different versions of the same site.

I need to accomplish this by having different versions of the same resource files.

I would like to store the different versions of the same resource files in seperate projects in the same solution. Then choose which project of resource files to use when I publish or compile.

I've been searching the net everywhere and my deadline is coming up.

View 1 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

Security :: Managing Users And Roles Across Different Projects In A Solution?

May 27, 2010

Initially, in my solution I had one project, and had set up all that is required for asp.net security, and that includes users and roles and access rules, etc. All of that was and still is working fine.

Now I added another project to my solution, and my first project points to pages in the second project.

The problem is that it seems like the users and roles are not being transferred accross projects. Not sure if I am explaining my problem correctly...if not, feel free to ask...

Its my first time trying to manage users and roles accross projects within a solution.

View 1 Replies

Localization :: Storing Resource Files In Different Projects In Same Solution?

Jan 14, 2011

I have a project at work where I need different versions of the same site.

I need to accomplish this by having different versions of the same resource files.

I would like to store the different versions of the same resource files in seperate projects in the same solution. Then choose which project of resource files to use when I publish or compile.

I've been searching the net everywhere and my deadline is coming up.

View 8 Replies

How To Place Aspx-files In Separate Web Application Projects In One Solution

Oct 21, 2010

We have been building ASP.Net websites for many years. During this time we gathered a lot of knowledge of ASP.Net. We know what to use, a what not. One problem is still, persistently, bugging us. I hope to solve this for once and for all.

We have a fairly large solution with lots of aspx-files. All aspx-files reside in one Web Application Project. This single big WAP needs to be split in multiple smaller projects.

There are a number of ways to accomplish this, but I am still unsure what the best way would be. We use ASP.Net 4.0 and Visual Studio 2010 Premium.

This is our current work-around (which we do not like)

[code]....

View 2 Replies

C# - Visual Studio 2010: How To Enforce Build Order Of Projects In A Solution

Sep 6, 2010

I had no problem with this in Visual Studio 2008 but it seems that VS 2010 is having an issue, and I'm betting it's probably me.I have a solution with an ASP.NET Web Site Project and a few C# projects (BLL, DAL, Tests in NUnit). I have configured the build process for the test project to automatically run NUnit to run the tests. I would like to ensure that the BLL and DAL projects build before the test project so that the tests will run against the latest compiled version (yes, I know I could do this all in one project, but I'm choosing not to -- please bear with me :) )

So, I set the dependencies of the Test project to include the BLL, DAL, and Web Application projects, and the build order shows BLL, DAL, Web Application, and then Tests. However, I noticed that the BLL doesn't actually build when I build the Test project.Any idea what this could be or any option I might be missing to force the other projects to build when I build the Test project?

View 3 Replies

Localization :: Store The Different Versions Of The Same Resource Files In Seperate Projects In The Same Solution?

Jan 18, 2011

I have a project at work where I need different versions of the same site.

I need to accomplish this by having different versions of the same resource files.

I would like to store the different versions of the same resource files in seperate projects in the same solution. Then choose which project of resource files to use when I publish or compile.

I've been searching the net everywhere and my deadline is coming up.

View 2 Replies

Visual Studio :: Sharing A Solution File - Projects Settings/Configurations Maintenance?

Sep 1, 2010

I am using VS2005 and I have a solution file (.SLN) which has 8 projects. I moved the solution file to a different path on a shared folder to have better organization of my projects and to allow access to the solution/projects from any computer on the network. After that, I edited the .SLN file so that the path of the projects in the solution file are correct (all on shared folders).

After that, I opened the .SLN and everything seemd to be working fine. However, I notcied that the "Start Options" of the website part of the solution file is missing the "Start Options", ie, the Start Options are reset to default values. I think also, but not sure, some other settings of the Solution/Projects have been reset.

Questions:

1. Where the Web Site "Start Options" are stored ?

2. How I can maintain the Start Options and similar settings if the .SLN file is moved or opened from different computers on the network ?

3. I am not using an team development tools, only plain (vanilla) VS 2005 Prof. Edition. Is it possible to have 2 or more developers work on the same solution/projects (shared on the network), if both developers will coordinate manually simultanous access to the porject files/resources/source code ?

View 6 Replies

Could/Should Use Static Classes In C# For Shared Data?

May 7, 2010

I'm building an online system to be used by school groups. Only one school can log into the system at any one time, and from that school you'll get about 13 users. They then proceed into a educational application in which they have to co-operate to complete tasks, and from a code point of view, sharing variables all over the place.

I was thinking, if I set up a static class with static properties that hold the variables that are required to be shared, this could save me having to store/access the variables in/from a database, as long as the static variables are all properly initialized when the application starts and cleaned up at the end. Of course I would also have to put locks on the get and set methods to make the variables thread safe.

Something in the back of my mind is telling me this might be a terrible way of going about things, but I'm not sure exactly why, so if people could give me their thoughts for or against using a static class in this situation,

View 1 Replies

Web Forms :: Finding Barcode Solution On Shared Host

May 12, 2010

I have a need to generate a barcode on an ASP.NET page. I know how to do this, but the catch is I need this to work on a shared hosting environment. Being a shared host, I don't have the ability to install custom barcode fonts on the server.

Does anyone know of any barcode solutions (possibly open source) that encapsulate fonts in the bin assembly and don't require the barcode fonts to be installed on the server?

View 3 Replies

The Best Way To Fire Events From Classes Within The Solution With A Timer?

Mar 22, 2010

A group I am in at school is developing a website for a client. It needs to be able to send weekly emails out to all users, as well perform many other scheduled tasks.My question is: what is the best way to fire events from classes within the solution with a timer? I've read that a Windows Service can be used...?

View 2 Replies

How To Get Classes To Expose The Same Shared / Static Method

Mar 4, 2010

I have a base class with several derived classes. I want all of my derived classes to have the same Public Shared (static) method with their own implementation. How do I do this?

View 3 Replies

Web Forms :: Shared Functions And Classes Error

Oct 4, 2010

I have some code in my new asp.net app that I need to share. So i created a shared class called
"utilities.vb" and put it in the APP_CODE folder. There is a function I have in there that pulls a person's image based off of their MemberId.

[Code]....

And I can call this function from my page using utilities.FcnGetMemberImage(). Ok, so all good so far until it complains about...

"Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class"

when referring to the Server.MapPath()

But the problem is that if I don't make it a Shared Function, I can't access it from my other pages. But if I do make it a Shared Function, it throws this error. The fix is supposed to be that I either don't share the function, or

"add the shared keyword to the member declaration", according to Microsoft at
http://msdn.microsoft.com/en-us/library/xfsswe45.aspx

But I'm not exactly sure how to "add the shared keyword to the member declaration" or what this means exactly and how this might affect other parts of my code?

Or is there a better way to work around this dilemma?

View 3 Replies

Web Forms :: Unable To Create Shared Classes In The Website

Jul 9, 2010

Whenever I create a new folder in my website (VS008) and add an item (Class) it can't be seen by the other pages, even though new class is public. Only if I add the class to the app_code folder or create a bin folder for it then it could be shared from these folders however I want to create my own custom named folders for organization and keep my classes there.

View 2 Replies

Visual Studio :: Add Shared Classes / Files Into Project

Feb 20, 2011

VWD 2010 Express.

We have shared CSharp classes put into a shared folders for re-use. Now I want to add those classes into my project by creating a new folder:

1) Right click the solution,
Add -> New Folder
Give it a new, eg. SharedClasses

2) Right click the new folder "SharedClasses"
Add- > Existing Item...

Browse to the "Shared Folder", include those shared classes. But those files are added physically into the folder "SharedClasses" rather than a reference. How do I just add a link to those shared files? Since these files might be modified from time to time, I don't want to delete and add those file frequently.

View 3 Replies

Visual Studio :: Solution Explorer Only Creates Visual Basic LinqToSql Classes?

Feb 14, 2010

Even though I when I create a linqtosql class I mark C# as the language it was always shows up as a Visual Basic file in the App Code file. I can't get it to stop doing that. ????? What is going on?

View 5 Replies

Private Shared Vs Public Shared Vs Protected Shared

Jan 5, 2010

let me know what does these access modifiers means.private shared vs public shared vs protected shared

View 5 Replies

Visual Studio :: Old Projects Not Showing Up In The Start Page Recent Projects List?

Jan 31, 2011

I just moved to a new PC and installed VS 2010. I copied all of my websites over from the old machine and now when I open the old websites on the new machine, they do not show up in my recent projects list on the start page. New websites that I make do show up there but the old ones do not. This is very inconvenient. Is there a way to make old projects that I open show up in the list?

This brings up another question. Is there a way to make a shortcut that will open VS2010 up with a website already loaded so that I don't have to go through the file open dialog every time?

View 3 Replies

Start Breaking Into Multiple Projects From The Beginning And Others Build Behemoth Single Projects?

Jul 29, 2010

I've seen some teams that start breaking into multiple projects from the beginning and others build behemoth single projects. The large project teams say that one massive project is easier to maintain than multiple smaller projects.

View 4 Replies

Popularity: Web Site Projects Versus Web Application Projects?

Nov 1, 2010

I need to create a sample project (for educational purposes) and I'm faced with the choice between Web Site Projects or Web Application Projects. This feels similar to the choice between C# and VB. My question isn't about the differences between these 2 choices, but rather which is more popular (relevant, recognizable) to the general ASP.NET community.Has anyone seen any statistics in terms of adoption/usage of these 2 different project types? What project type should I use to reach the widest audience?Update: I created a poll on this subject - http://poll.fm/2e6cy

View 4 Replies







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