Help with "Cannot find ContentTypeReader BB.HeightMapInfoReader, BB, Version=1.0.0.0, Culture=neutral." needed
Posted
by
rFactor
on Game Development
See other posts from Game Development
or by rFactor
Published on 2011-03-19T17:53:43Z
Indexed on
2011/03/20
0:18 UTC
Read the original article
Hit count: 364
Hi,
I have this irritating problem in XNA that I have spent my Saturday with:
Cannot find ContentTypeReader BB.HeightMapInfoReader, BB, Version=1.0.0.0, Culture=neutral.
It throws me that when I do (within the game assembly's Renderer.cs class):
this.terrain = this.game.Content.Load<Model>("heightmap");
There is a heightmap.bmp and I don't think there's anything wrong with it, because I used it in a previous version which I switched to this new better system.
So, I have a GeneratedGeometryPipeline
assembly that has these classes: HeightMapInfoContent
, HeightMapInfoWriter
, TerrainProcessor
. The GeneratedGeometryPipeline
assembly does not reference any other assemblies under the solution.
Then I have the game assembly that neither references any other solution assemblies and has these classes: HeightMapInfo
, HeightMapInfoReader
.
All game assembly classes are under namespace BB
and the GeneratedGeometryPipeline
classes are under the namespace GeneratedGeometryPipeline
.
I do not understand why it does not find it. Here's some code from the GeneratedGeometryPipeline.HeightMapInfoWriter
:
/// <summary>
/// A TypeWriter for HeightMapInfo, which tells the content pipeline how to save the
/// data in HeightMapInfo. This class should match HeightMapInfoReader: whatever the
/// writer writes, the reader should read.
/// </summary>
[ContentTypeWriter]
public class HeightMapInfoWriter : ContentTypeWriter<HeightMapInfoContent>
{
protected override void Write(ContentWriter output, HeightMapInfoContent value)
{
output.Write(value.TerrainScale);
output.Write(value.Height.GetLength(0));
output.Write(value.Height.GetLength(1));
foreach (float height in value.Height)
{
output.Write(height);
}
foreach (Vector3 normal in value.Normals)
{
output.Write(normal);
}
}
/// <summary>
/// Tells the content pipeline what CLR type the
/// data will be loaded into at runtime.
/// </summary>
public override string GetRuntimeType(TargetPlatform targetPlatform)
{
return "BB.HeightMapInfo, BB, Version=1.0.0.0, Culture=neutral";
}
/// <summary>
/// Tells the content pipeline what worker type
/// will be used to load the data.
/// </summary>
public override string GetRuntimeReader(TargetPlatform targetPlatform)
{
return "BB.HeightMapInfoReader, BB, Version=1.0.0.0, Culture=neutral";
}
}
Can someone help me out?
© Game Development or respective owner