Issue with particle system

Mar 8, 2012 at 3:27 PM

Hi,


I use the last Sunburn version (2.0.18) and the last IGF sources and i try to test the particle system.

I have added the IGF particle project in my solution and when i compiled my project works fine.

But, when i add The IGF ProjectMercuryContentPipeline to my content references, my compiler throw this error :

Building content threw Exception : Error loading content repository '[A]SynapseGaming.LightingSystem.Core.ContentRepository cannot be cast to [B]SynapseGaming.LightingSystem.Core.ContentRepository. Type A originates from 'SynapseGaming-SunBurn-Pro, Version=2.0.18.7, Culture=neutral, PublicKeyToken=c23c60523565dbfd' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_32\SynapseGaming-SunBurn-Pro\v4.0_2.0.18.7__c23c60523565dbfd\SynapseGaming-SunBurn-Pro.dll'. Type B originates from 'SynapseGaming-SunBurn-Processors-Pro, Version=2.0.18.7, Culture=neutral, PublicKeyToken=c23c60523565dbfd' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_32\SynapseGaming-SunBurn-Processors-Pro\v4.0_2.0.18.7__c23c60523565dbfd\SynapseGaming-SunBurn-Processors-Pro.dll'.'.


What is the proper way to include the ProjectMercuryContentPipeline to the content references  ?

 

Thank you in advance.

 

Coordinator
Mar 9, 2012 at 11:03 AM

This is mostly due to an issue with the ContentRepository xml file which is targeting a previous version of SunBurn. Make sure to change the reference in the xml file to point the SunBurn version you have in your machine.

Mar 9, 2012 at 10:16 PM

Thank you for your answer.

My content.repo file targeting the 2.0.18.7 version of SunBurn but I have the same issue. I have created a new issue: http://igf.codeplex.com/workitem/668 to add a project example.

 

Mar 14, 2012 at 1:54 AM

I'm running into a very similar issue with a new project. When I try and build the project with a repo and ProjectMercury.ContentPipeline.dll under Sunburn 2.0.18.7 i get the following build error:

Error    5    Building content threw ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at Q.p.[T](List`1 , Boolean , Boolean , Boolean )
   at SynapseGaming.LightingSystem.Processors.PipelineInfoImporter.(PipelineInfoContent )
   at SynapseGaming.LightingSystem.Processors.PipelineInfoImporter.Import(String filename, ContentImporterContext context)
   at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context)
   at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAssetDirectly(BuildItem item, String importerName)
   at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAsset(BuildItem item)
   at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAssetWorker(BuildItem item)
   at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAsset(BuildItem item)
   at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAndLoadAsset(BuildItem item, BuildItem requestingItem)
   at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAssetViaCache(BuildItem item, String importerName)
   at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAsset(BuildItem item)
   at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAssetWorker(BuildItem item)
   at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAsset(BuildItem item)
   at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.RunTheBuild()
   at Microsoft.Xna.Framework.Content.Pipeline.Tasks.BuildContent.RemoteProxy.RunTheBuild(BuildCoordinatorSettings settings, TimestampCache timestampCache, ITaskItem[] sourceAssets, String[]& outputContent, String[]& rebuiltContent, String[]& intermediates, Dictionary`2& dependencyTimestamps, KeyValuePair`2[]& warnings) 

If I remove ProjectMercury.ContentPipeline.dll from the project, it builds fine. The Sunburn forums seem to indicate this error can crop up with custom processors. I'm currently using build 12732 of IGF, but I can try updating to the most current source and see if it clears up.

Coordinator
Mar 14, 2012 at 11:47 AM

In the latest changesets, I made some reference changes in the whole solution so that it doesn't ask for a specific SunBurn version. This could do the trick.

Moreover, in case you didn't noticed, the reference in the Project Mercury related toolset is set to use SunBurn Indie and if you don't own it, it could also be one of the reasons of the issue.

Coordinator
Mar 14, 2012 at 12:04 PM

Ok, looking at the exception more closely, it seems that I have some circular references with SunBurn that are generating this issue when building content.

Therefore, I need to get the Mercury source code in another assembly and use it as the reference in the ContentProcessor instead of the whole IGF Particle assembly.

I put the Project Mercury source code in the assembly for the sake of having a smaller set of references to add to your projects but since this seems to be a technical requirement, I'll probably just remove it from the assembly and integrate the Project.Mercury binaries directly. I'll keep you in touch with this.

Mar 14, 2012 at 12:19 PM

Thank you very much for look at this issue. It's a good news.

Mar 14, 2012 at 11:16 PM

Sounds likely. I know it was working fine when i was building an older IGF against Sunburn 2.0.17, but I don't know if that makes much of a difference.

The good news (for me) is I don't really need to get into particles for a while, so I can work around/without it for a little while.

Coordinator
Mar 16, 2012 at 2:14 AM

Hi guys,

Just a word to let you know that the latest changeset should get the issue solved.

Let me know if that isn't the case ;)

Mar 17, 2012 at 2:41 AM

Seems to have solved my issue, though I had to go into the properties for the Mercury assembly and either check Allow Unsafe Code or remove the UNSAFE condition before it would build error-free. Otherwise, seems to be resolved, though I haven't actually tried to use the assemblies in code yet.

Coordinator
Mar 17, 2012 at 12:52 PM

Hmmm... I initially got this issue too but it wasn't related to unsafe as if I rebuild the solution twice, it actually builds successfully.

I believe this is due to some sort of build/dependency order. I'll check it and solve the issue asap.

Mar 19, 2012 at 2:00 PM

Hi,

I have tried this new version.

I have also an issue with the unsafe mode but it's because the unsafe mode in the properties of the IGF.Particle project is not cheched.

If i check this box everything works fine.

It's perfect. Thank you very much.