Monogame Content Pipeline has stopped working - c#

The other day I started up my monogame project and started it up to do a quick play test. It wouldn't work. I was getting 2 errors.
Error 1 The command "SETX MONOGAME_PLATFORM "PSM" > NUL" exited with code 9009. GameName1
Error 2 Metadata file 'C:\Users\Sean\Desktop\Prog\Learning\3D Learning\GameName1\GameName1\bin\PSM\IgnoreMe.dll' could not be found C:\Users\Sean\Desktop\Prog\Learning\3D Learning\3D Learning\CSC 3D Learning
And here is the output from the build.
1>------ Build started: Project: Learnplscon, Configuration: PSM Any CPU ------
1> MonoGame Platform PSM
1> 'SETX' is not recognized as an internal or external command,
1> operable program or batch file.
1>C:\Program Files (x86)\MSBuild\MonoGame\v3.0\MonoGame.ContentPipeline.targets(22,7): error MSB3073: The command "SETX MONOGAME_PLATFORM "PSM" > NUL" exited with code 9009.
2>------ Build started: Project: learnpls, Configuration: Debug x86 ------
2>CSC : error CS0006: Metadata file 'C:\Users\Sean\Desktop\Prog\Learning\learnpls\Learnplscon\Learnplscon\bin\PSM\IgnoreMe.dll' could not be found
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
But Building from last successful build works.
I did not change anything. And any new project I make gets the same problem.
The problem only happens when I add a reference to my content project.
(Referenced project this way: monogame-managing-content )
I made a new project, ran it, everything worked fine. Created a mono game content project, ran it and everything worked fine. Then I added the reference and got the errors. And when I remove the reference Error 2 goes away but error 1 is still there, but the project will run fine.
I have tried reinstalling xna, and monogame. Also tried to reinstall visual studios. I spent all night trying to find an answer online but came up with nothing.
I am using the most recent version of XNA and Monogame 3.2, and I am using windows 8.1.

In case you're still having this problem, or someone else finds the question (like I did trying to solve this a little while ago): for me, the problem was that my windows/system32 directory wasn't in my 'path' environment variable. That's where the setx.exe program resides, and the XNA content project seems to assume that it can call setx without qualifying the path.
Note: Visual Studio seems to need to be restarted after you've added your /system32 directory to the path.

Related

Error Metadata file dll could not be found CSC when publishing

I have a Visual studio solution with several projects in it, specifically a DotNet5 asp.net app, that has several netstandard 2.0 references on it. it builds and runs fine in the debugger but continuously throws the metadata errors. It keeps specifically referencing its looking for a net5 folder in the netstandard2 project. I cannot find where its getting this from, the problematic one used to be a multitargeted project against framework 4.7, 4.8, and net5.0, but i got annoyed with the multiple dll's and just migrated it to standard2.0 and had no issues till i want to publish it.
I've tried what a few other questions referenced, cleaning, rebuilding, remove and re add references to other projects, deleted the obj and bin folders out of the solution, the removing the sou file, tried VS 2019 (16.9.0 preview 2) preview vs 2019 (16.8.3) release, different computer (pulled back down from a lan git repository) and got the same error.... also tried searching the entire solution for references to net5.0 and didn't find it outside of the expected locations like the csproj for the asp.net project and its respective pubxml. And just for fun, I temporarily retargeted the library project back to net5.0 and it still threw the same error even when the exact file and path listed did exist.
Using enters for the error below for the different columns in the error message, and removed the "sensitive" info. There is no error code provided by Visual Studio. Anyone else got any more ideas on what to try?
Error
Metadata file 'C:\Users\UserName\source\repos\Solution\Project 2\bin\Release\net5.0\ref\Project 2.dll' could not be found.
Project 1
CSC
0
Edit: adding a couple other sections of the error messages:
1/2/2021 7:38:55 PM
System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.<---
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
===================
And the end of the output window since full thing is a bit too long. still can't figure out where its getting the net5.0 for the one project reference
/reference:C:\Users\UserName\.nuget\packages\system.xml.xpath.xmldocument\4.0.1\ref\netstandard1.3\System.Xml.XPath.XmlDocument.dll /reference:C:\Users\UserName\.nuget\packages\mysql.data\8.0.22\lib\net5.0\Ubiety.Dns.Core.dll /reference:"C:\Users\UserName\source\repos\CheckNotes\Project 3\bin\Release\netstandard2.0\Project 3.dll" /reference:"C:\Users\UserName\source\repos\CheckNotes\Project 2\bin\Release\net5.0\ref\Project 2.dll" /reference:C:\Users\UserName\source\repos\CheckNotes\Project 4\bin\Release\netstandard2.0\Project 4.dll /reference:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\WindowsBase.dll" /reference:C:\Users\UserName\.nuget\packages\mysql.data\8.0.22\lib\net5.0\Zstandard.Net.dll /debug+ /debug:portable /filealign:512 /optimize+ /out:"obj\Release\net5.0\CheckNotes Web - Core.dll" /refout:"obj\Release\net5.0\ref\CheckNotes Web - Core.dll" /target:exe /warnaserror- /utf8output /deterministic+ /langversion:9.0 /analyzerconfig:"obj\Release\net5.0\CheckNotes Web - Core.GeneratedMSBuildEditorConfig.editorconfig" /analyzerconfig:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\analyzers\build\config\AnalysisLevel_5_Default.editorconfig" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Mvc.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Components.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\targets\..\analyzers\Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\targets\..\analyzers\Microsoft.CodeAnalysis.NetAnalyzers.dll" Controllers\AssemblyController.cs Controllers\CheckNotesController.cs Controllers\ContactsController.cs Controllers\CustomerController.cs Controllers\HomeController.cs Controllers\ImageController.cs Controllers\OperatorPagesController.cs Controllers\PalletsController.cs Controllers\SharedController.cs Controllers\StatisticsController.cs Models\ControllerClass\ctrlrAssembly.cs Models\ControllerClass\CtrlrCheckNotes.cs Models\ControllerClass\ctrlrContacts.cs Models\ControllerClass\CtrlrCustomer.cs Models\ControllerClass\CtrlrOperatorPages.cs Models\ControllerClass\CtrlrPallet.cs Models\ControllerClass\ctrlrStats.cs Models\DataClass\AppSettings.cs Models\ErrorViewModel.cs Models\renderAction.cs Program.cs Startup.cs "obj\Release\net5.0\.NETCoreApp,Version=v5.0.AssemblyAttributes.cs" "obj\Release\net5.0\CheckNotes Web - Core.AssemblyInfo.cs" "obj\Release\net5.0\CheckNotes Web - Core.RazorAssemblyInfo.cs" /warnaserror+:NU1605
CSC(0,0): Error CS0006: Metadata file 'C:\Users\UserName\source\repos\CheckNotes\Project 2\bin\Release\net5.0\ref\Project 2.dll' could not be found
10>Build failed. Check the Output window for more details.
========== Build: 9 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
Got it to publish but I am so confused....something to do with the publish profile. If i delete that and generate a new one, works fine. as soon as i edit it using the GUI, broken....generate it again. So far seems ok to edit it manually but TBD. not sure if the "fix" will survive restarting Visual studio or not.
Edit - Scratch that, found the difference.
Remove the following line in Properties/FolderProfile.pubxml and it's fine.
<TargetFramework>net5.0</TargetFramework>

Out of memory error when compiling UWP app in release mode with .Net native

I have a solution where my main project is a uwp app, and two other projects referenced by the app :
UWP App ---> references 2.
Universal Class library ----> references 3.
PCL Library
2 --> uses EF7 and SQLight.
3 --> uses PCLCrypto
Now, everything works just fine and excellent when I'm on Debug mode x86 targeting local machine.
I want to compile the solution in release mode using .Net native tool chain, here's my config :
When I launch the compilation, it takes a remarkably long time, and too much memory is consumed by the .Net native tools :
After some time, everything stops with 2 errors on visual studio :
Here's what the output window says :
1>------ Build started: Project: ServerCommunication, Configuration:
Release Any CPU ------ 1> ServerCommunication ->
C:\Users\aymen\Documents\Visual Studio
2015\Projects\Applinova\Liberte\ServerCommunication\bin\Release\ServerCommunication.dll
2>------ Build started: Project: NewspaperDataLayer, Configuration:
Release x86 ------ 2>C:\Users\aymen\Documents\Visual Studio
2015\Projects\Applinova\Liberte\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets(225,5):
warning : All projects referencing ServerCommunication.csproj must
install nuget package Microsoft.Bcl.Build. For more information, see
http://go.microsoft.com/fwlink/?LinkID=317569. 2> NewspaperDataLayer
-> C:\Users\aymen\Documents\Visual Studio 2015\Projects\Applinova\Liberte\NewspaperDataLayer\bin\x86\Release\NewspaperDataLayer.dll
3>------ Build started: Project: Liberte, Configuration: Release x86
--some warnings here that I just skipped
3> Starting .NET Native compilation 3> Processing application code
3>C:\Users\aymen\Documents\Visual Studio
2015\Projects\Applinova\Liberte\Liberte\Resources.System.Linq.Expressions.rd.xml(35):
warning : Method 'CreateLambda' within
'System.Linq.Expressions.Expression' could not be found.
3>C:\Users\aymen\Documents\Visual Studio
2015\Projects\Applinova\Liberte\Liberte\Resources.System.Linq.Expressions.rd.xml(91):
warning : Method 'ParameterIsAssignable' within
'System.Linq.Expressions.Expression' could not be found. 3> Computing
application closure and generating interop code 3> Generating
serialization code 3> Compiling interop code 3> Cleaning up
unreferenced code 3> Generating native code 3>STARTPROCESSTASK :
error : Out of Memory 3>C:\Program Files
(x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets(1129,5):
error : ILT0005: 'C:\Program Files
(x86)\MSBuild\Microsoft.NetNative\x86\ilc\Tools\nutc_driver.exe
#"C:\Users\aymen\Documents\Visual Studio
2015\Projects\Applinova\Liberte\Liberte\obj\x86\Release\ilc\intermediate\MDIL\Liberte.rsp"'
returned exit code 1
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
What would possibly be wrong with this please ??
I had the same problem (I am also using EF7 and other libraries) but I solved using Visual Studio 15 preview (it is not visual studio 2015 update 2, which I didn't try). They improved the .NET native tools so now you should not have any problem, even if using a lot of third party library.
UPDATE
I have solved all my issues after i have installed visual studio 2015 update 3 and switched from EF7 to EF core also available via nuget
I have been struggled past few days around trying to fix this problem, but currently there is no easy solution for it.
There is a closed Issue on EF7 github, more info here (https://github.com/aspnet/EntityFramework/issues/4387) where they suggest as solution update EF7 to v1.0.0-rc2-16898.
I didn't manage how to update and as it still a nightly version, my final solution ("fast" workaround) was change my entire DB to sqlite-pcl (https://visualstudiogallery.msdn.microsoft.com/4913e7d5-96c9-4dde-a1a1-69820d615936).
If you aren't in a rush to lunch your application, you can always wait until final version of RC2 it should be done during April.

Building C# .NET in command line gives error: Package 'Code Analysis Package' failed to load

I am compile a sample C# .NET project using build.cmd file. The content of the build.cmd is as bellow.
build.cmd
#echo off
setlocal
set devenv="c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.com"
del *.log >nul
%devenv% WindowsFormsApplication3.sln /rebuild "Release" /out WindowsFormsApplication3.log
if ERRORLEVEL 1 GOTO failed
findstr /C:"========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========" WindowsFormsApplication3.log >nul
if ERRORLEVEL 1 GOTO failed
echo *** BUILD SUCCESSFUL ***
pause
goto :EOF
:failed
echo.
echo.
echo *** BUILD FAILED ***
pause
Project compiles properly. But when i opened the log file it hassome error
WindowsFormsApplication3.log
1>------ Rebuild All started: Project: WindowsFormsApplication3, Configuration: Release Any CPU ------
Package 'Code Analysis Package' failed to load.
1> WindowsFormsApplication3 -> E:\Bin\junk\WindowsFormsApplication3\WindowsFormsApplication3\bin\Release\WindowsFormsApplication3.exe
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
I don't why i am getting this error (Package 'Code Analysis Package' failed to load) in log file.
I searched online but did not get any help.
how to solve this problem?
Note: WindowsFormsApplication3 is a sample project. i Opened VS2015 and New Project -> Visual C# -> Windows Form Application. I did not change any thing in the project.
Give Microsoft a chance to analyze and fix the problem.
I created a connect issue because the problem occurs on two PCs that both have vanilla VS 2015 installations.
https://connect.microsoft.com/VisualStudio/feedback/details/2423616/package-code-analysis-package-failed-to-load
Within the next few weeks, a guy from Microsoft will probably comment on that. You can followup there.

SQL CLR no longer deploys to SQL 2008

I have a SQL CLR project that deploys stored procs to a server. For 2 years I've always been able to just right click the project and deploy. Yesterday I have started to get errors when I try to do that. I was able to deploy a new version last week but not this week.
------ Build started: Project: '', Configuration: Debug Any CPU ------
'' -> E:\Development\Code\SqlDeployables\''\bin\Debug\''.dll
------ Deploy started: Project: '', Configuration: Debug Any CPU ------
Error: Class not registered.
Looking for object with CLSID: {475E0C1F-1E61-4197-9324-10A148C512F8}.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
I've been searching around and can't find anything on the error. There has been no updates on the sql server since I could last deploy. I have uninstalled my VS2010 updates as well as .net updates on my machine and that has not done anything. The only updates I have not uninstalled were office ones, which I would think are not the problem.
Any ideas? I've tried resetting permissions on the sql machine. Removed Stored procs manually and redeploy. I've gone back to a previous version of the project and tried to deploy. Restarted SQL Server services on machine.
Visual Studio 2010
SQL Server 2008
Thanks
Somehow your visual studio install has gotten messed up. That CLSID points to the class Microsoft.VisualStudio.Data.Schema.Package.Sql.Internal.ManagedBuildLoggerComClass in the com object C:\Windows\system32\mscoree.dll.
I would recommend trying to do a repair install on visual studio and see if that fixes your issue.
I had the same problem, and I couldn't figure out how to solve it. I think it might have something to do w/ a side-by-side install of VS2012, but I am not sure.
As a workaround I wrote my own T-SQL deploy script. The project builds all right, and it outputs dlls all right. All that is missing is the database deploy (ie, the commands that VS runs against the database to actually deploy your types and methods to the server). In the project's bin folder you may find the .sql file that VS generates; you can use this as a template. The deploy script will end up looking something like this:
USE SomeDatabase
GO
IF OBJECT_ID('dbo.[SomeFunction]') IS NOT NULL DROP FUNCTION dbo.[SomeFunction]
IF EXISTS (SELECT * FROM sys.assemblies WHERE NAME = 'SomeAssembly') DROP ASSEMBLY [SomeAssembly]
GO
CREATE ASSEMBLY [SomeAssembly] AUTHORIZATION dbo
FROM '\path\to\your\dll'
WITH PERMISSION_SET = SAFE
GO
CREATE FUNCTION [dbo].[SomeFunction] ....
EXTERNAL NAME [SomeAssembly].[SomeAssembly.UserDefinedFunctions].[SomeMethod]
GO
Then deploy your stuff manually via SSMS.

MonoMac Build Error From Default Template

I am trying to use MonoDevelop 3.0.3.2 to create a MonoMac application. I created a new MonoMac solution and tried running the template created after creating the solution, but this is my build output:
Building Solution: MAC1 (Debug|x86)
Building: MAC1 (Debug|x86)
Performing main compilation...
/Library/Frameworks/Mono.framework/Versions/2.10.9/bin/dmcs /noconfig
"/out:/Users/zgillis/Projects/MAC1/bin/Debug/MAC1.exe"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Xml.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Core.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Xml.Linq.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Drawing.dll"
"/r:/Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/MonoMac.dll" /nologo /warn:4 /debug:full /optimize- /codepage:utf8 /platform:x86
"/define:DEBUG" /t:exe "/Users/zgillis/Projects/MAC1/MainWindow.cs"
"/Users/zgillis/Projects/MAC1/MainWindowController.cs"
"/Users/zgillis/Projects/MAC1/MainWindow.designer.cs"
"/Users/zgillis/Projects/MAC1/Main.cs" "/Users/zgillis/Projects/MAC1/AppDelegate.cs"
"/Users/zgillis/Projects/MAC1/AppDelegate.designer.cs"
Copying content files
Copying '/Users/zgillis/Projects/MAC1/bin/Debug/MAC1.exe' to
'/Users/zgillis/Projects/MAC1/bin/Debug/MAC1.app/Contents/MonoBundle/MAC1.exe'
Copying '/Users/zgillis/Projects/MAC1/bin/Debug/MAC1.exe.mdb' to
'/Users/zgillis/Projects/MAC1/bin/Debug/MAC1.app/Contents/MonoBundle/MAC1.exe.mdb'
Build complete -- 0 errors, 0 warnings
Updating application manifest
---------------------- Done ----------------------
Build successful.
Build failed. The given key was not present in the dictionary.
I am running Mac OS X Snow Leopard (10.6.8), and my Xcode version is 3.2.2.
It will not allow me to compile even the default MonoMac template, so I know I must have something configured incorrectly. I appreciate the help.
It looks like your version of Xcode is old - it's likely that MonoDevelop's support for reading values from the older Apple SDKs' plists has regressed. I would suggest you either upgrade Xcode, or file a bug with the MonoDevelop log file (found in ~/Library/Logs/MonoDevelop-3.0) attached.

Categories