On Fri, 26 Aug 2011 17:14:43 -0700, Peter Duniho
<(E-Mail Removed)> wrote:
>On 8/26/11 1:42 PM, Gene Wirchenko wrote:
>> Dear C-Sharpies:
[snip]
>> 3) The IDE is confusing at times. In particular, when I add an
>> existing file to a project, they do not show up anywhere, but then
>> they are in the project anyway.
>
>Please be more specific. Describe _exactly_ what steps you are doing,
>giving precise statements about what menu commands, keyboard shortcuts,
>etc. you are using.
>
>Adding anything to a project, including an existing file, will result in
>the newly added item being visible in the project (typically you'd look
>in the Solution Explorer to view the project contents).
>
>If you are unable to see items added to the project, either your
>installation of Visual Studio is broken or you are not doing what people
>would normally consider to be "adding an existing file to a project".
Start -- Programs -- Microsoft Visual Studio 2010 Express -- Microsoft
Visual C# 2010 Express
Click on "New Project...", select "Console Application", enter
application name of "PointerPlayaround", and click OK.
At this point, I would like to delete Program.cs from the project
and from existence period. How? I think that it will not be saved
anywhere because I have not saved the project, but I do not know this.
Project -- Add Existing Item... --
C:\cbs2dev\CSharp\ch07code\PointerPlayaround.cs -- Add
Project -- Add Existing Item... --
C:\cbs2dev\CSharp\ch07code\PointerPlayaround2.cs -- Add
The filenames do not show up only some class definitions in the
class view. I do not see how classes and files fit together, that is,
which classes are in which files.
Build -- Build Solution
Error because both of the files that I added have a Main(). When
I use class view to get to the code, I can only see one.
With PointerPlayaround2.cs in focus, Project -- Exclude from
Project. Note that if I did not know what classes were in the file I
had just added, I would have to actually look at the file outisde of
Visual Studio to determine a unique class name that it has so that I
could select that and get the code to display so I could remove it. (I
know of no other way, short of recreating the project.) If the file
had no unique class names, I do not know how I would be able to remove
it, yet I would have compilation errors for the duplicate class
definitions.
Try adding it again:
Project -- Add Existing Item... --
C:\cbs2dev\CSharp\ch07code\PointerPlayaround2.cs -- Add
and get a message that it already exists: "A file with the name
'PointerPlayaround2.cs' already exists. Do you want to replace it?".
It thought it was the same file. Does it get copied into the project
directory structure? Where exactly is it so that I can delete it?
Remove it again.
Build -- Build Solution
Error because both .cs files (Program and PointerPlayaround) have
a Main() (though in different classes).
Exclude Program from the project.
Build -- Build Solution
F5
Execution at last. (Actually, I skipped the bit about setting so
the unsafe code will compile and run.)
If I save the project, does that save everything in it to the
same directory structure?
Sincerely,
Gene Wirchenko
|