The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by lbarash]

csc /target:module /out:person.mod person.cs

The above command was ok. However when I tried to add the person.mod to the
assembly I got the following error. CS1031 people.cs(7,16): Type expected.
I used the same command as in the book.

csc /addmodule:person.mod people.cs
import-bot (20211) [Avatar] Offline
#2
Re: chapter 2 section 2.5.1 multifile assembly
[Originally posted by fgrimes]

Hi Leonard,

Sorry for my delayed reply... I'm travelling in Europe at the moment.

The error message indicates an error at line 7, position 16 in people.cs.
That would be the word "void" on the following line:

public static void Main() {

Have you inadvertently changed the file? I've appended the original below.
Let me know if OK.

Regards,
Fergal

=========================================
// file : people.cs
// compile : csc /addmodule:person.mod people.cs

using System;

public class People {
public static void Main() {

Person p = new Person("Joe", "Bloggs", 40);
Console.WriteLine(
"{0} {1} is {2} years old.",
p.FirstName,
p.LastName,
p.Age
);
}
}
mbiglan (1) [Avatar] Offline
#3
Re: chapter 2 section 2.5.1 multifile assembly
i had the same problem. i downloaded the source on the web and there is a colon between public static and void Main() {

by the way -- great book!

mike