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
[Originally posted by hwayoungko]

I tested this example..

using System;
using System.Reflection;


public class Person {
public Person(string firstName, string lastName, int age) {
AssemblyName aName=GetType().Assembly.GetName();
Console.WriteLine("name : {0}",aName.Name);
Console.WriteLine("Version : {0}",aName.Version);
public readonly string FirstName;
public readonly string LastName;
public readonly int Age;

and I succeeded till registering 2 assemblies to winnt/assembly ...

when I was excuting this command ,, hadn't been changed to

I made person1000 and person2000 under inetpub/wwwroot/ .

this'd be problem?


<requiredRuntime safeMode="true" version="v1.0.3705"/>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.vl">
<assemblyIdentity name="person">
<bindingRedirect oldVersion="">

in this coding,
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.vl">

Now I'm thinking, here might have caused problem not to working properly.

every machine definitely has asm.vl file? or else, my machine didn't got this

file, so in my case, my machine can't understand this type of xml file?

I did everything according to the book. filename is people.exe.config and

it's located on the same directory with people.exe. but result is always . It never changed

Please help me.

import-bot (20211) [Avatar] Offline
Re: person.exe.config
[Originally posted by fgrimes]

Hi Hwayoung,

I set this example up once again to see if something had changed, but it
worked fine. Therefore I can only suggest that you carefully retrace the
steps presented in section 2.6. As you do this, try the following:

1. Move the files out of inetpub/wwwroot/. (No good reason, just one less
2. Make sure to create separate subdirecories for v1.0.0.0 and v2.0.0.0 of
3. Compile both DLLs from parent directory:
CsmilieotNetcha_2>csc /target:library /out:person1000person.dll
CsmilieotNetcha_2>csc /target:library /out:person2000person.dll
4. Execute gacutil from parent directory for both DLLs as shown in fig 2.9.
5. Compile people:
csc /r:person1000/person.dll people.cs

You can use the following simpler config file:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="person" publicKeyToken="xxxxxxxxxxxxxxxx" />
<bindingRedirect oldVersion="" newVersion=""/>

Just remember to insert the correct publicKeyToken generated by gacutil.
Explore C:WINNTAssembly to find the correct value.

Let me know what happens.

import-bot (20211) [Avatar] Offline
Re: person.exe.config
[Originally posted by dennisjmurphy]

I've just fixed the problem described here myself. The publicKeyToken value in
the people.exe.config file MUST match the Public Key token for the assemblies
you created. Check the token in the global assembly cache and use that value
in the config file.

Dennis Murphy