Two Major Conversion Errors

Jul 1, 2010 at 8:48 PM

Got two errors that I'd really like some help with.

1. Error 7 The "ValidateXaml" task failed unexpectedly.
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\Daniel\Documents\Visual Studio 2010\Projects\FinalTest\FinalTest\Bin\Debug\SilverArcade.SilverSprite.Core.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Users\Daniel\Documents\Visual Studio 2010\Projects\FinalTest\FinalTest\Bin\Debug\SilverArcade.SilverSprite.Core.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
   at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
   at Microsoft.Silverlight.Build.Tasks.ValidateXaml.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)

This can be stopped by editing my VWDExpress.exe.config file to allow loadFromRemoteSources. . . sometimes. Seriously, I've compiled it this way (though the application did not work) and got a web browser up. Othertimes the dang thing just keeps insisting there's a problem.

2. There's an unhandled exception when I add my canvas: type universe cannot resolve assembly: SilverArcade.SilverSprite, Version=3.1.0.0, Culture=neutral,PublicKeyToken=null. I have beat my head against a wall all day to the point of absolute frustration with this thing, and no one on the web seems to have any answers.

Again, I'd really appreciate some help. If I can get SilerSprite to work, I'd really like to put together a tutorial video showing people how to use SilverSprite without the terrific headache I'm getting from it.

Jul 2, 2010 at 12:40 AM

I was afraid this might happen. . . I (kind of) solved the problem. Well, here's the solution to anyone else encountering these bugs.

Apparently, from my experience today, SilverSprite and Visual Web Developer Express 2010 don't mix too well. I may have done something wrong, but either way I've got it working and am incredibly happy. Now the true fun will begin. So, here's the deal on getting SilverSprite set up (from my perspective):

1. It may do you well to go ahead and remove any version of Silverlight that you have installed. Seriously.

2. Get Visual Web Developer Express 2008 (assuming you're a pauper like me)

3. Download the Silverlight 2.0 Tools for VWD Express (I can't remember the exact name. . . I can give you links if you need em')

4. Install Silverlight 2.0 Tools. You will most likely encounter a fatal error if you have another version of Silverlight installed. So get rid of it.

5. Pull up VWDE 2008, add your XNA .CS files (for the record, you don't have to have program.cs), include the Silversprite .DLLs by right clicking Referecnes in the solution explorer, add the code to your page.xaml file, and enjoy!

Hope this can help someone who may have been encountering the same troubles that I was. Now that it's working, I can truly say that this will be nothing short of AWESOME when it comes to developing web games!

Developer
Jul 2, 2010 at 5:51 AM
Good you made it work. I just have a question. You say you need to download the Silverlight 2.0 Tools? As far as I know, the current release SilverSprite 3.0 Alpha 2, is for Silverlight 3 - this might course some problems? If you use the latest version from the trunk (Source code tab), it's build for VS2010 and Silverlight 4 - so if you use this you might have even more problems :)
Jul 3, 2010 at 4:34 PM

I have worried about that a bit. All I know is that, at the moment, SilverSprite is working like a charm and absolutely rocks. I'll probably try repeating the process all over again sometime in the future. . . when I've already made my fortune deploying SilverSprite games :) (yeah, that'll be the day. . .). I know that the way I'm doing it is far from idea and, frankly, doesn't even make much sense to me.

So, to put it in the words of Col. Jack O'Neil, if I have problems "I'll cross that bridge when I get to it."

Jul 3, 2010 at 9:53 PM

Yes you had a problem with using the wrong version of Silversprite with Visual Web Developer.

IF YOU GO TO "SOURCE CODE" and download the latest source, you have Silverlight 4.0. Look at build 47340. It specifically says "Converted to Silverlight 4"

In that case, you need to use Visual Web Developer 2010, Silverlight 4.0, Silverlight Developer Runtime, and Silverlight 4 Tools.

 

I believe if you get the code from the DOWNLOAD tab, that is using Silverlight 3 and the solution you posted above.