Jump to content
  • Advertisement
Sign in to follow this  
Thekill473

Having a somewhat difficult error(C# XNA)

This topic is 2340 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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:

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;
}
}
}


Thankyou for reading i apreciate your time.

Share this post


Link to post
Share on other sites
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!