[SOLVED] Pipeline extension 3.8 not finding nuget files

Hi

I’m trying to port a pipeline extension I have to MG 3.8. Extension Project compiles fine but when i try to use it loading content it seems like the nuget(s) i added are missing. Do i have to do some magic to make the .net standard 2.0 pipeline extension work in my .net core 3.1 project?

I’m not super confident navigating/changing project files so i might be missing something obvious. It all works fine under MG 3.7 but there all the projects are .net framework 4.x.

Is there a way to make the pipeline extension in .net core 3.1 instead of .net standard 2.0? But then again I’m using the official MG 3.8 templates so i don’t know if this is the wrong solution to my problem.

Any other ideas?

Build logg:

1>    System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. The file can not be found.
1>    File name: 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
1>       at PyxelPipeline.PyxelImporter.Import(String filename, ContentImporterContext context)
1>       at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context) in C:\BuildAgents\MonoGameWin1\work\f7381a85a626990\MonoGame.Framework.Content.Pipeline\ContentImporter.cs:line 45
1>       at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent(PipelineBuildEvent pipelineEvent) in C:\BuildAgents\MonoGameWin1\work\f7381a85a626990\MonoGame.Framework.Content.Pipeline\Builder\PipelineManager.cs:line 669
1>
1>
1>    C:\Users\_\.nuget\packages\monogame.content.builder.task\3.8.0.1641\build\MonoGame.Content.Builder.Task.targets(138,5): error MSB3073: The command "dotnet C:\Users\_\.nuget\packages\monogame.content.builder.task\3.8.0.1641\build\\..\tools\netcoreapp3.1\any\mgcb.dll /quiet /@:"C:\Users\_\source\repos\Cockroachie\Cockroachie.Shared\Content\Content.mgcb" /platform:DesktopGL /outputDir:"C:/Users/_/source/repos/Cockroachie/Cockroachie.Shared/Content/bin/DesktopGL/Content" /intermediateDir:"C:/Users/_/source/repos/Cockroachie/Cockroachie.Shared/Content/obj/DesktopGL/Content" /workingDir:"C:/Users/_/source/repos/Cockroachie/Cockroachie.Shared/Content/"" exited with code 1.
1>  Done executing task "Exec" -- FAILED.

I just rebuilt a test project on a new box with a clean vs 2019 install and only MG 3.8 “installed”.

I get the same file not found error as above and it doesnt mather what i try to include. freeimage, json they all fail.

Is there some problem with the Pipeline Extension Template?

What should i try next, any idee?

Maybe i’m not explaining this very well.

I have created a Pipeline Extension project to read some Json data. Addning Newtonsoft.Json to the project.

explorer

When i try to use the pipeline i get the following error:

Not much to go on but in the build log it states:
System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json,

Is the error being thrown when you’re building the assets? If you build it manually by the monogame content pipeline editor does it throw the error?

Yes.

How are you importing the pipeline assembly into the pipeline config? What does your reference look like? You should have a line that looks like this

/reference:my_assembly_computer_path.dll

Yes and the path is correct… well i dont know but it exists

files

#----------------------------- Global Properties ----------------------------#

/outputDir:bin/$(Platform)
/intermediateDir:obj/$(Platform)
/platform:DesktopGL
/config:
/profile:Reach
/compress:False

#-------------------------------- References --------------------------------#
/reference:..\..\PyxelPipeline\bin\Debug\netstandard2.0\PyxelPipeline.dll
#---------------------------------- Content ---------------------------------#

#begin file.pyxel
/importer:PyxelImporter
/processor:PyxelProcessor
/build:file.pyxel

Pretty sure if you check that folder, then Newtonsoft.Json.dll isn’t there, since it’s default behaviour for dotnet to reference nuget assemblies directly from their cached location, instead of copying it over to the intermediate build directory. And that is why it’s crashing I bet, if you force copy over the dll it probably works.

I’m guessing it doesn’t resolve the assembly because the Pipeline editor probably loads your assembly by reflection and then it can’t correctly resolve dependencies or somethings. It’s possible that this can be resolved, I urge you to open a issue on the GitHub repo about it.

You are correct!

I copied the dll from my .nuget folder to the build folder and it worked perfectly!

files_2

I urge you to open a issue on the GitHub repo about it.

Are you sure this an issue with MonoGame 3.8?

Thank you very much for your help!

Are you sure this an issue with MonoGame 3.8?

Referencing assemblies with external dependencies from the pipeline editor can no longer be done as convenient as it could in 3.7, and that was introduced in 3.8 with the move to the new dotnet core.

1 Like

Glad I popped in here just now, Pyxel was actually a candidate name for my engine :stuck_out_tongue: have chosen another name already a few months ago though, but this was something close to being used :stuck_out_tongue: So, Nice name!

In this context pyxel refers to a pixel editor with the same name (https://pyxeledit.com/). My custom pipeline unpacks the savefile and makes animations for the artists.

1 Like

This is apparently the default behavior of .NET Core. To change that i used the setting blow in my vs project file. If this is the right/best way i dont know but it works.

<PropertyGroup>
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

FreeImage still wont work

System.DllNotFoundException: Unable to load DLL ‘FreeImage’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I tried reinstalling the redistributables suggested in this tread but it dint help:

Again my 3.7.1 project works fine but if i try to use Freeimage in 3.8 i get the “Unable to load DLL” error.

What do i do to include all the dependencies to my .net core standrad project?

Have you tried throwing it into the output folder after compilation?

Yes all the files are present and accounted for. And replaced with diffrent versions and copys.

Its like… some dependecy of freeimage is missing but i dont know.

I tryed upping the loglevel and reading evrything but i still have no clue what im doing wrong. Its frustrating that the “compiler” cant give me a straight answer whats missing.

Hopefully someone with experience in this can assist further.

Yes and thank you!

My plan is to make a minimal project on git and post it for you all to try. Maybe its my way of setting up visualstudio or something some one can deduce by the way i structure my solution. But im beat by all the testing, reading and googleing so i will do that next week.

It still amazes me how many things about game programming have absolutely nothing to do with coding :slight_smile:

1 Like

This shuld be marked as solved. I made another topic about the FreeImage problem Pipeline extension 3.8 Unable to load DLL 'FreeImage'