dwwilson66
dwwilson66

Reputation: 7066

I need help understanding some finer points of Visual Studio 2010

This question is a followup to an earlier question and subsequent questions raised by research on MSDN per the links provided in the answer.

Here's an image of the solution explorer I've set up so far & I want to make sure I'm on the right track organizationally.

enter image description here

First, because VS2010 is for a C# Class I'm taking, I'm organizing a ProgrammingClass solution (ITDEV110) and Assignment projects (ASSN3a, ASSN3b) within that solution. I read somewhere that a solution is like a house and a project like a room...so this makes good organizational sense to me.

Given that organizational strategy, I can't find the best way to save a copy of Assignment1 as the basis of Assignment2. Sometimes I get proj2's *csproj file in the proj2 path, but the *cs files in the proj1 path. Other times, my *cs files show up in solution explorer as a dotted outline icon (not the *._cs in the pic). I can still click, edit and save, but they still look like ghost classes in explorer--and I'm not sure what that dotted ghost line means to the compile and run.

So how can I move *cs files between projects in a single solution without

  1. confusing VS2010 into thinking it has two Mains, and
  2. ensuring the right versions of classes and methods are called?

Is it just a matter of "Save As..." a new project name? Or should I create a new project from existing code? Is this a job for namespaces? How does this differ if I want SOME of the code from #1 to BE accessible from #2?

I've been doing a lot of creating new classes for my programs by cutting-pasting from notepad...but I know there's got to be a better way.

Any resources or tips would be awesome.

Upvotes: 0

Views: 113

Answers (1)

Dai
Dai

Reputation: 154995

Create a new different C# project for each programming assignment you get. Feel free to use the same Solution, but it's best to keep projects separate. It is possible to share files between projects (using Linked files), or references types and classes from other projects using Project References, but putting school work code into the same C# project is a lesson in pain.

Upvotes: 2

Related Questions