Sign in to follow this  
Thekill473

Having a somewhat difficult error(C# XNA)

Recommended Posts

Well Its got to do with another XnaSerializer and the problem is that it cant find: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate;
Even though it's been referenced and all. Ive tried reinstalling Xna and the .net framework but to no avail.

Heres the error and the seemingly related warning i get:
Error 4 The type or namespace name 'Pipeline' does not exist in the namespace 'Microsoft.Xna.Framework.Content' (are you missing an assembly reference?) Line: 9 Column: 39 LevelEditor

And the warning:
Warning 1 The referenced assembly "Microsoft.Xna.Framework.Content.Pipeline, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" could not be resolved because it has a dependency on "Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project. LevelEditor

And just to run home what an ultimate kick in the teeth this is, visual studios decided to grey out the target framework box in the properties.

any way heres the code:
[CODE]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate;
namespace LevelEditor
{
static class XnaSerializer
{
public static void Serialize<T>(string filename, T data)
{
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
using (XmlWriter writer = XmlWriter.Create(filename, settings))
{
IntermediateSerializer.Serialize<T>(writer, data, null);
}
}

public static T Deserialize<T>(string filename)
{
T data;
using (FileStream stream = new FileStream(filename, FileMode.Open))
{
using (XmlReader reader = XmlReader.Create(stream))
{
data = IntermediateSerializer.Deserialize<T>(reader, null);
}
}
return data;
}
}
}
[/CODE]

Thankyou for reading i apreciate your time.

Share this post


Link to post
Share on other sites
I'm currently not behind my PC but did you also add the references physically to your project? Also i believe you need to change some properties for your project so it gets full .net access. The intermediate Serializer can be a real pain, i fiddled for days with it and still not exactly sure how it works exactly.

Did you lookup the the blog from Shawn Hargreaves, it should state somewhere exactly how to reference it in the intermediateSerializer section. You could also try his section on the content pipeline since it's related.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this