Coder Social home page Coder Social logo

Comments (7)

dntpannik avatar dntpannik commented on July 17, 2024

Seems like if I add another intermediate project I get a different error.

image

My project I'm working on is pretty big and is actually used with several different front-end solutions. So I created another intermediate project to hold the WPF components to be consumed.

image

In this example the TowerNxt.WPF consumes the Aries3D.WPF project which intern consumes the Aries3D.Core project. In the provided solution attached to this message all projects are set to compile as AnyCPU.

The DifferentFolders is how I would want the solution to be organized. But I also attached it where the entire solution is in a single folder to simplify the problem

TowerNxt-DifferentFolders.zip
TowerNxt-SingleFolderAnyCPU.zip

Thanks

from stride.

dntpannik avatar dntpannik commented on July 17, 2024

When looking at the build output I actually saw this stack trace for the second issue

info 0.006s: [AssetCompiler] Starting builder.

3> EXEC : error 6.521s: [AssetCompiler] Unhandled exception. Exception: TypeInitializationException: The type initializer for 'Stride.Core.Assets.AssetCloner' threw an exception.
3> ---> TypeInitializationException: The type initializer for 'Stride.Core.Serialization.SerializerSelector' threw an exception.
3> ---> TypeInitializationException: The type initializer for '' threw an exception.
3> ---> FileNotFoundException: Could not load file or assembly 'PresentationFramework, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
3> at System.ModuleHandle.ResolveType(QCallModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
3> at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
3> at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
3> at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(MetadataToken caCtorToken, MetadataImport& scope, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder1& derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctorWithParameters, Boolean& isVarArg) 3> at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder1 derivedAttributes) 3> at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType) 3> at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit) 3> at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit) 3> at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](Assembly element) 3> at System.Resources.ManifestBasedResourceGroveler.GetNeutralResourcesLanguage(Assembly a, UltimateResourceFallbackLocation& fallbackLocation) 3> at System.Resources.ResourceManager.CommonAssemblyInit() 3> at GNU.Gettext.GettextResourceManager..ctor(String baseName, Assembly assembly) 3> at Stride.Core.Translation.Providers.GettextTranslationProvider..ctor(String baseName, Assembly assembly) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.Translation\Providers\GettextTranslationProvider.cs:line 34 3> at Stride.Core.Translation.Providers.GettextTranslationProvider..ctor(Assembly assembly) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.Translation\Providers\GettextTranslationProvider.cs:line 25 3> at Stride.Core.Translation.Providers.GettextTranslationProvider..ctor() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.Translation\Providers\GettextTranslationProvider.cs:line 19 3> at Stride.Core.Presentation.Module.Initialize() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\presentation\Stride.Core.Presentation.Wpf\Module.cs:line 17 3> at .cctor() 3> at System.RuntimeTypeHandle.GetActivationInfo(ObjectHandleOnStack pRuntimeType, * ppfnAllocator, Void** pvAllocatorFirstArg, * ppfnCtor, BOOL* pfCtorIsPublic) 3> at System.RuntimeType.ActivatorCache..ctor(RuntimeType rt) 3> at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) 3> at Stride.Core.Serialization.SerializerSelector.UpdateDataSerializers() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core\Serialization\SerializerSelector.cs:line 271 3> at Stride.Core.Serialization.SerializerSelector.Initialize() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core\Serialization\SerializerSelector.cs:line 101 3> at Stride.Core.Serialization.SerializerSelector..cctor() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core\Serialization\SerializerSelector.cs:line 45 3> at Stride.Core.Serialization.SerializerSelector..ctor(Boolean reuseReferences, Boolean externalIdentifiableAsGuid, String[] profiles) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core\Serialization\SerializerSelector.cs:line 17 3> at Stride.Core.Assets.AssetCloner..cctor() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\AssetCloner.cs:line 38 3> at Stride.Core.Assets.AssetItem.Clone(Boolean keepPackage, UFile newLocation, Asset newAsset, AssetClonerFlags flags) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\AssetItem.cs:line 139 3> at Stride.Core.Assets.AssetItem.Clone(UFile newLocation, Asset newAsset, AssetClonerFlags flags) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\AssetItem.cs:line 120 3> at Stride.Core.Assets.Analysis.AssetCollision.<>c__DisplayClass0_0.<Clean>b__1(AssetItem item) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\Analysis\AssetCollision.cs:line 48 3> at System.Linq.Enumerable.SelectListIterator2.Fill(ReadOnlySpan1 source, Span1 destination, Func2 func) 3> at System.Linq.Enumerable.SelectListIterator2.ToList()
3> at Stride.Core.Assets.Analysis.AssetCollision.Clean(Package package, ICollection1 inputItems, ICollection1 outputItems, AssetResolver assetResolver, Boolean cloneInput, Boolean removeUnloadableObjects) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\Analysis\AssetCollision.cs:line 48
3> at Stride.Core.Assets.Package.ValidateAssets(Boolean alwaysGenerateNewAssetId, Boolean removeUnloadableObjects, ILogger log) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\Package.cs:line 784
3> at Stride.Core.Assets.PackageSession.LoadAssets(PackageSession session, ILogger log, Package package, PackageLoadParameters loadParameters, List1 pendingPackageUpgrades, PackageLoadParameters newLoadParameters) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSession.cs:line 1519 3> at Stride.Core.Assets.PackageSession.LoadMissingAssets(ILogger log, IEnumerable1 packages, PackageLoadParameters loadParametersArg) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSession.cs:line 974
3> at Stride.Core.Assets.PackageSession.LoadMissingReferences(ILogger log, PackageLoadParameters loadParameters) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSession.cs:line 917
3> at Stride.Core.Assets.PackageSession.Load(String filePath, PackageSessionResult sessionResult, PackageLoadParameters loadParameters) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSession.cs:line 855
3> at Stride.Core.Assets.PackageSession.Load(String filePath, PackageLoadParameters loadParameters) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSession.cs:line 905
3> at Stride.Core.Assets.CompilerApp.PackageBuilder.BuildMaster() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets.CompilerApp\PackageBuilder.cs:line 91
3> at Stride.Core.Assets.CompilerApp.PackageBuilder.Build() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets.CompilerApp\PackageBuilder.cs:line 57
3> at Stride.Core.Assets.CompilerApp.PackageBuilderApp.Run(String[] args) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets.CompilerApp\PackageBuilderApp.cs:line 288
3> System.TypeInitializationException: The type initializer for 'Stride.Core.Assets.AssetCloner' threw an exception.
3> ---> System.TypeInitializationException: The type initializer for 'Stride.Core.Serialization.SerializerSelector' threw an exception.
3> ---> System.TypeInitializationException: The type initializer for '' threw an exception.
3> ---> System.IO.FileNotFoundException: Could not load file or assembly 'PresentationFramework, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
3> File name: 'PresentationFramework, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
3> at System.ModuleHandle.ResolveType(QCallModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
3> at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
3> at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
3> at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(MetadataToken caCtorToken, MetadataImport& scope, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder1& derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctorWithParameters, Boolean& isVarArg) 3> at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder1 derivedAttributes) 3> at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType) 3> at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit) 3> at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit) 3> at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](Assembly element) 3> at System.Resources.ManifestBasedResourceGroveler.GetNeutralResourcesLanguage(Assembly a, UltimateResourceFallbackLocation& fallbackLocation) 3> at System.Resources.ResourceManager.CommonAssemblyInit() 3> at GNU.Gettext.GettextResourceManager..ctor(String baseName, Assembly assembly) 3> at Stride.Core.Translation.Providers.GettextTranslationProvider..ctor(String baseName, Assembly assembly) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.Translation\Providers\GettextTranslationProvider.cs:line 34 3> at Stride.Core.Translation.Providers.GettextTranslationProvider..ctor(Assembly assembly) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.Translation\Providers\GettextTranslationProvider.cs:line 25 3> at Stride.Core.Translation.Providers.GettextTranslationProvider..ctor() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.Translation\Providers\GettextTranslationProvider.cs:line 19 3> at Stride.Core.Presentation.Module.Initialize() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\presentation\Stride.Core.Presentation.Wpf\Module.cs:line 17 3> at .cctor() 3> --- End of inner exception stack trace --- 3> at System.RuntimeTypeHandle.GetActivationInfo(ObjectHandleOnStack pRuntimeType, * ppfnAllocator, Void** pvAllocatorFirstArg, * ppfnCtor, BOOL* pfCtorIsPublic) 3> at System.RuntimeType.ActivatorCache..ctor(RuntimeType rt) 3> at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) 3> at Stride.Core.Serialization.SerializerSelector.UpdateDataSerializers() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core\Serialization\SerializerSelector.cs:line 271 3> at Stride.Core.Serialization.SerializerSelector.Initialize() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core\Serialization\SerializerSelector.cs:line 101 3> at Stride.Core.Serialization.SerializerSelector..cctor() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core\Serialization\SerializerSelector.cs:line 45 3> --- End of inner exception stack trace --- 3> at Stride.Core.Serialization.SerializerSelector..ctor(Boolean reuseReferences, Boolean externalIdentifiableAsGuid, String[] profiles) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core\Serialization\SerializerSelector.cs:line 17 3> at Stride.Core.Assets.AssetCloner..cctor() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\AssetCloner.cs:line 38 3> --- End of inner exception stack trace --- 3> at Stride.Core.Assets.AssetItem.Clone(Boolean keepPackage, UFile newLocation, Asset newAsset, AssetClonerFlags flags) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\AssetItem.cs:line 139 3> at Stride.Core.Assets.AssetItem.Clone(UFile newLocation, Asset newAsset, AssetClonerFlags flags) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\AssetItem.cs:line 120 3> at Stride.Core.Assets.Analysis.AssetCollision.<>c__DisplayClass0_0.<Clean>b__1(AssetItem item) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\Analysis\AssetCollision.cs:line 48 3> at System.Linq.Enumerable.SelectListIterator2.Fill(ReadOnlySpan1 source, Span1 destination, Func2 func) 3> at System.Linq.Enumerable.SelectListIterator2.ToList()
3> at Stride.Core.Assets.Analysis.AssetCollision.Clean(Package package, ICollection1 inputItems, ICollection1 outputItems, AssetResolver assetResolver, Boolean cloneInput, Boolean removeUnloadableObjects) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\Analysis\AssetCollision.cs:line 48
3> at Stride.Core.Assets.Package.ValidateAssets(Boolean alwaysGenerateNewAssetId, Boolean removeUnloadableObjects, ILogger log) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\Package.cs:line 784
3> at Stride.Core.Assets.PackageSession.LoadAssets(PackageSession session, ILogger log, Package package, PackageLoadParameters loadParameters, List1 pendingPackageUpgrades, PackageLoadParameters newLoadParameters) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSession.cs:line 1519 3> at Stride.Core.Assets.PackageSession.LoadMissingAssets(ILogger log, IEnumerable1 packages, PackageLoadParameters loadParametersArg) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSession.cs:line 974
3> at Stride.Core.Assets.PackageSession.LoadMissingReferences(ILogger log, PackageLoadParameters loadParameters) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSession.cs:line 917
3> at Stride.Core.Assets.PackageSession.Load(String filePath, PackageSessionResult sessionResult, PackageLoadParameters loadParameters) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSession.cs:line 855
3> at Stride.Core.Assets.PackageSession.Load(String filePath, PackageLoadParameters loadParameters) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\PackageSession.cs:line 905
3> at Stride.Core.Assets.CompilerApp.PackageBuilder.BuildMaster() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets.CompilerApp\PackageBuilder.cs:line 91
3> at Stride.Core.Assets.CompilerApp.PackageBuilder.Build() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets.CompilerApp\PackageBuilder.cs:line 57
3> at Stride.Core.Assets.CompilerApp.PackageBuilderApp.Run(String[] args) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets.CompilerApp\PackageBuilderApp.cs:line 288

from stride.

Doprez avatar Doprez commented on July 17, 2024

I tried running the source to debug this and its a bit weird. I noticed that if I run the build from the Stride Gamestudio I dont have any errors..

Its important to note that the folders in the solution "shouldnt" matter, my project is the below mess of what I try to organize and I havent had this error before.
image

This specific error seems to be narrowed down to happening when only using VS2022 to build the project with the AssetCompiler. so either Gamestudio is using the compiler differently or it could be msbuild(I believe the Gamestudio still uses this for builds) vs dotnet as well.

from stride.

Doprez avatar Doprez commented on July 17, 2024

huh, it does seem like VS AssetCompiler is different than the Gamestudio.

image

Top is VS and bottom is Gamestudio.

from stride.

dntpannik avatar dntpannik commented on July 17, 2024

Thanks for looking into this. I think folder structure was a bit of a mislead. The problem seems to be caused by me introducing a third intermediary project (Aries3D.WPF) and having TowerNxt.WPF reference that project.

As a test I forced my output path to match yours like this

image

However I got the same error but now our Output Paths match

image

If there's anything else I can do to help you or anyone else out let me know.

from stride.

Doprez avatar Doprez commented on July 17, 2024

Debugging this is brutal but I did find out one more thing.

Removing the AssetCompiler completely seems to build and then removing the base.Draw() in teapotDemo seems to let it run. I have no clue what this breaks lol but your Teapot demo seems to work as expected.

Make sure to clean the poroject after removing.

from stride.

Doprez avatar Doprez commented on July 17, 2024

@xen2 would you have an easy way of seeing why the error is being thrown? I think I narrowed it down to AssetCloner.Clone() on line 225 but I cant see what is throwing an error, Im guessing due to threading?

from stride.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.