PC Review


Reply
Thread Tools Rate Thread

C# Questions

 
 
Gene Wirchenko
Guest
Posts: n/a
 
      26th Aug 2011
Dear C-Sharpies:

I have some general questions that I have not been able to find
the answers for:

1) I am using Visual C# 2010 Express. The text that I am using
refers to command-line invocation of the compiler. What is the name
of the compiler's executable? They use csc.exe, but this does not
appear to be the name.

2) Is it possible to have my code default to checked?
a) If so, how do I set this?
b) If not, what is the easiest way to do this? Would putting a
checked block encompassing each source file do it?

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. (This caused me a problem when I
added a file that had duplicate class names in it. I could not figure
out how to remove the file from the project or how to edit it within
the project to correct the duplicate names.)

4) Is there anything else that commonly feeds on C# newbies that you
would be so nice as to warn me about?

Sincerely,

Gene Wirchenko
 
Reply With Quote
 
 
 
 
Arne Vajhøj
Guest
Posts: n/a
 
      27th Aug 2011
On 8/26/2011 4:42 PM, Gene Wirchenko wrote:
> I have some general questions that I have not been able to find
> the answers for:
>
> 1) I am using Visual C# 2010 Express. The text that I am using
> refers to command-line invocation of the compiler. What is the name
> of the compiler's executable? They use csc.exe, but this does not
> appear to be the name.


It is the name.

C:\Windows\Microsoft.NET\Framework\v4.0.30319>dir csc.exe
Volume in drive C is ARNEPC4
Volume Serial Number is F878-3B24

Directory of C:\Windows\Microsoft.NET\Framework\v4.0.30319

03/18/2010 01:16 PM 1,972,552 csc.exe

or similar based on versions.

> 2) Is it possible to have my code default to checked?
> a) If so, how do I set this?
> b) If not, what is the easiest way to do this? Would putting a
> checked block encompassing each source file do it?


command line:

csc /checked+

VS:

project
properties
build
advanced

> 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. (This caused me a problem when I
> added a file that had duplicate class names in it. I could not figure
> out how to remove the file from the project or how to edit it within
> the project to correct the duplicate names.)


I don't think I have problems doing that.

> 4) Is there anything else that commonly feeds on C# newbies that you
> would be so nice as to warn me about?


Assuming C# is like language X is a common cause for confusion.

Arne
 
Reply With Quote
 
RayLopez99
Guest
Posts: n/a
 
      27th Aug 2011
On Aug 27, 3:42*am, Gene Wirchenko <ge...@ocis.net> wrote:
> Dear C-Sharpies:
>
> * * *I have some general questions that I have not been able to find
> the answers for:
>
> * 1) I am using Visual C# 2010 Express. *The text that I am using
> refers to command-line invocation of the compiler. *What is the name
> of the compiler's executable? *They use csc.exe, but this does not
> appear to be the name.
>
> * 2) Is it possible to have my code default to checked?
> * * *a) If so, how do I set this?
> * * *b) If not, what is the easiest way to do this? *Would putting a
> checked block encompassing each source file do it?
>
> * 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. *(This caused me a problem when I
> added a file that had duplicate class names in it. *I could not figure
> out how to remove the file from the project or how to edit it within
> the project to correct the duplicate names.)
>
> * 4) Is there anything else that commonly feeds on C# newbies that you
> would be so nice as to warn me about?
>
> Sincerely,
>
> Gene Wirchenko


Good luck with your C# Express adventure. I personally have found the
"Express editions" are not quite 100% compatible with the other
editions in functionality--by definition of course. So I make sure I
get the "pro" version whenever possible. You can get an academic
discount from most places even without showing you are still in
university. Or you can take your chances and download it from a
torrent site, which 95% of the time is as good as the genuine product.

RL
 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      27th Aug 2011
On 8/27/2011 11:24 AM, RayLopez99 wrote:
> On Aug 27, 3:42 am, Gene Wirchenko<ge...@ocis.net> wrote:
>> Dear C-Sharpies:
>>
>> I have some general questions that I have not been able to find
>> the answers for:
>>
>> 1) I am using Visual C# 2010 Express. The text that I am using
>> refers to command-line invocation of the compiler. What is the name
>> of the compiler's executable? They use csc.exe, but this does not
>> appear to be the name.
>>
>> 2) Is it possible to have my code default to checked?
>> a) If so, how do I set this?
>> b) If not, what is the easiest way to do this? Would putting a
>> checked block encompassing each source file do it?
>>
>> 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. (This caused me a problem when I
>> added a file that had duplicate class names in it. I could not figure
>> out how to remove the file from the project or how to edit it within
>> the project to correct the duplicate names.)
>>
>> 4) Is there anything else that commonly feeds on C# newbies that you
>> would be so nice as to warn me about?


> Good luck with your C# Express adventure. I personally have found the
> "Express editions" are not quite 100% compatible with the other
> editions in functionality--by definition of course. So I make sure I
> get the "pro" version whenever possible. You can get an academic
> discount from most places even without showing you are still in
> university. Or you can take your chances and download it from a
> torrent site, which 95% of the time is as good as the genuine product.


But illegal 100% of the time!

Arne


 
Reply With Quote
 
Markus Schaber
Guest
Posts: n/a
 
      27th Aug 2011
Hallo,

RayLopez99 <(E-Mail Removed)> schrieb:

> Good luck with your C# Express adventure. I personally have found the
> "Express editions" are not quite 100% compatible with the other
> editions in functionality--by definition of course. So I make sure I
> get the "pro" version whenever possible. You can get an academic
> discount from most places even without showing you are still in
> university. Or you can take your chances and download it from a
> torrent site, which 95% of the time is as good as the genuine product.


Other free alternatives are SharpDevelop and MonoDevelop.



Gruss,
Markus

--
"Not everything that counts can be counted, and not everything that can
be counted counts." A sign hanging in Einstein's office at Princeton.

 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      28th Aug 2011
On 8/27/2011 4:42 PM, Markus Schaber wrote:
> RayLopez99<(E-Mail Removed)> schrieb:
>> Good luck with your C# Express adventure. I personally have found the
>> "Express editions" are not quite 100% compatible with the other
>> editions in functionality--by definition of course. So I make sure I
>> get the "pro" version whenever possible. You can get an academic
>> discount from most places even without showing you are still in
>> university. Or you can take your chances and download it from a
>> torrent site, which 95% of the time is as good as the genuine product.

>
> Other free alternatives are SharpDevelop and MonoDevelop.


Or maybe even Eclipse with Emonic.

The C# community in general is very VS focused. And that
is a bit of a shame, because even though VS is a good product
then knowing more products broadens ones horizon.

And some of the alternatives especially SharpDevelop (which I have used
extensively) is actually pretty good.

Arne

 
Reply With Quote
 
Markus Schaber
Guest
Posts: n/a
 
      28th Aug 2011
Hallo,

Arne Vajhøj <(E-Mail Removed)> schrieb:

> On 8/27/2011 4:42 PM, Markus Schaber wrote:
> > RayLopez99<(E-Mail Removed)> schrieb:
> >> Good luck with your C# Express adventure. I personally have found the
> >> "Express editions" are not quite 100% compatible with the other
> >> editions in functionality--by definition of course. So I make sure I
> >> get the "pro" version whenever possible. You can get an academic
> >> discount from most places even without showing you are still in
> >> university. Or you can take your chances and download it from a
> >> torrent site, which 95% of the time is as good as the genuine product.

> >
> > Other free alternatives are SharpDevelop and MonoDevelop.

>
> Or maybe even Eclipse with Emonic.


AFAICS, Emonic does not support the normal .sln/.csproj msbuild
infrastructure - this is a huge disadvantage if you want to share your
projects with other developers.

> The C# community in general is very VS focused. And that
> is a bit of a shame, because even though VS is a good product
> then knowing more products broadens ones horizon.




> And some of the alternatives especially SharpDevelop (which I have used
> extensively) is actually pretty good.


SharpDevelop has some advantages (e. G. working parallel build
support, and working folder support) compared to the VS Express edition.

But neither of the free environments can compete with the high end
edition of visual studio, pimped with some plugins (Small ones like
GhostDoc, and more complex ones like ReSharper or CodeRush).

Which is a sad fact, compared to what Eclipse offers for Java for free
(and I think NetBeans is at the same level nowadays).



Gruss,
Markus

--
"Not everything that counts can be counted, and not everything that can
be counted counts." A sign hanging in Einstein's office at Princeton.

 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      31st Aug 2011
On 8/28/2011 3:28 AM, Markus Schaber wrote:
> Arne Vajhøj<(E-Mail Removed)> schrieb:
>> On 8/27/2011 4:42 PM, Markus Schaber wrote:
>>> RayLopez99<(E-Mail Removed)> schrieb:
>>>> Good luck with your C# Express adventure. I personally have found the
>>>> "Express editions" are not quite 100% compatible with the other
>>>> editions in functionality--by definition of course. So I make sure I
>>>> get the "pro" version whenever possible. You can get an academic
>>>> discount from most places even without showing you are still in
>>>> university. Or you can take your chances and download it from a
>>>> torrent site, which 95% of the time is as good as the genuine product.
>>>
>>> Other free alternatives are SharpDevelop and MonoDevelop.

>>
>> Or maybe even Eclipse with Emonic.

>
> AFAICS, Emonic does not support the normal .sln/.csproj msbuild
> infrastructure - this is a huge disadvantage if you want to share your
> projects with other developers.


True.

But some incl. me prefer NAnt over MSBuild anyway.

>> And some of the alternatives especially SharpDevelop (which I have used
>> extensively) is actually pretty good.

>
> SharpDevelop has some advantages (e. G. working parallel build
> support, and working folder support) compared to the VS Express edition.
>
> But neither of the free environments can compete with the high end
> edition of visual studio, pimped with some plugins (Small ones like
> GhostDoc, and more complex ones like ReSharper or CodeRush).


A lot of the extra stuff I don't need. Other people may of course
need it.

Arne


 
Reply With Quote
 
Gene Wirchenko
Guest
Posts: n/a
 
      31st Aug 2011
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
 
Reply With Quote
 
Gene Wirchenko
Guest
Posts: n/a
 
      31st Aug 2011
On Fri, 26 Aug 2011 17:14:43 -0700, Peter Duniho
<(E-Mail Removed)> wrote:

[snip]

>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).


Oh, now I see the filenames. It would have been much clearer if
it were called Project Explorer. This probably clears up most of my
problems, for now anyway.

>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".


Nope. Just missing a bit of vocabulary ("Solution Explorer").

Thank you.

Sincerely,

Gene Wirchenko
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bookmark questions Access/Word Error Message Two Questions Kenny G Microsoft Access Form Coding 0 1st Aug 2008 04:11 PM
Linksys NAS200 questions (general questions about RAID 0, 1) Aloke Prasad Storage Devices 0 6th Aug 2007 01:04 AM
Form that asks questions based on responses to other Questions =?Utf-8?B?YWtrcnVn?= Microsoft Access Getting Started 3 6th Jul 2007 02:43 PM
Re: After the Deletion of Google Answers, U Got Questions Fills the Gap Answering and Asking the Tough Questions sechumlib Microsoft C# .NET 0 7th May 2007 07:35 PM
SATA drive questions + raid questions O |V| 3 G A DIY PC 17 29th Sep 2003 11:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:28 PM.