How do I Include Dependencies for Namespace Name 'Microsoft'?

I’ve decided to check out DigitalRune Engine
WARNING!
If anyone wants to do so, DO NOT download Protobuild . Download Protobuild Manager instead (latest). I’m not sure about the WindowsInstaller. I used the source code.
Protobuild.exe in Protobuild is malware, according to anti-virus software.
The Protobuild.exe in Protobuild Manager didn’t set off any alarms.

I get this error while trying to build DigitalRune-Editor.
Error CS0246 The type or namespace name 'Microsoft' could not be found (are you missing a using directive or an assembly reference?)

I don’t know how to manually include the dependencies it’s missing.
I found some suggestions, like here, and I tried
PM> dotnet restore
Resulting in an error.
MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.

As you can see, that does not work for the solution.
Does anyone know another way… hopefully an easier way, I can include those dependencies?

I am looking at the Microsoft docs, to see I can learn more.

The dotnet restore command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project file. In most cases, you don’t need to explicitly use the dotnet restore command, since a NuGet restore is run implicitly if necessary when you run the following commands:

dotnet new
dotnet build
dotnet build-server
dotnet run
dotnet test
dotnet publish
dotnet pack
Sometimes, it might be inconvenient to run the implicit NuGet restore with these commands.

Implicit restore
Building requires the project.assets.json file, which lists the dependencies of your application. The file is created when dotnet restore is executed. Without the assets file in place, the tooling can’t resolve reference assemblies, which results in errors.

You don’t have to run dotnet restore because it’s run implicitly by all commands that require a restore to occur, such as dotnet new, dotnet build, dotnet run, dotnet test, dotnet publish, and dotnet pack. To disable implicit restore, use the --no-restore option.

The dotnet restore command is still useful in certain scenarios where explicitly restoring makes sense, such as continuous integration builds in Azure DevOps Services or in build systems that need to explicitly control when the restore occurs.

If this is the wrong place to post this, I apologize. I just thought they might be connected, since DigitalRune Engine is xna/monogame based.

Open up the folders and see if there are Dependencies/References listed and see if any of them are missing.

I just see monogame dependencies missing.
xnaerror2
However, I installed mgcb already, and a few others, using dotnet new --install …
However, nothing changed.

I don’t know anything about DigitalRune, but those look like missing projects.

That’s okay. I don’t think that’s important. The main problem lies here.
xnaerror3
I just need to get that dependency.
I know it’s on my computer, since I used it in other monogame projects.
xnaokay
I just don’t know how to manually inject it into this project. That’s all.

Should be NuGet Packages if you’re using the latest MonoGame. Right click on the Solution and Manage NuGet packages and add them if they don’t exist.

Add them? All of them?
I have no idea what I am doing.
There are many packages. Many Microsoft extension.
I typed in Microsoft.xna, and see a few monogame packages in browse. None in installed.
What packages i am looking for?

Will depend on the Platform you are Targeting. You could start with the DesktopGL.

Installed the DesktopGL, but that’s not the solution.
xnaerror4

Don’t download NuGet packages, if it were the NuGet packages that was the problem it would have been the responsibility of DigitalRune to set it up correctly.

The reason you’re not finding the namespace is because you’re not finding the projects as evident on your screenshot. I see that the project uses their own fork of MonoGame so even if you got the Nugets to work it would be risky because the code probably depends on changes they themselves made to MonoGame https://github.com/DigitalRune/DigitalRune#monogame-fork

Have you gotten git submodules? I can see in the repo that MonoGame is added as a submodule dependency https://stackoverflow.com/a/1032653

I had looked at the readme, and noticed the line

  1. Update all git submodules recursively (to load the MonoGame submodules).
    I downloaded the MonoGame.Dependencies-3.2 with the intent to shove them in the directory - not sure if that wouldhave worked.

I was looking into git submodules, and this seems like more trouble than I need to check out a program, So it doesn’t seem like DigitalRune is worthy of my time. I think I will just leave it alone. :smile:

I don’t want to waste your time either. Thanks.

I found something useful from looking at the documentation.

Also, I think it’s possible I can use a monogame project, and import the DigitalRune Engine into it. That should fix the problem of not finding Microsoft.xna.framework.

I also installed the DigitalRune nuget packages into the project. This should allow me to create my own project using DigitalRune projects and examples as templates.

I think I should be able to get things working. :smile:
I hope it’s worth all the trouble I went through. Lol.

Oh… and I found the solution. I had watched this video before, but had dismissed it, since I though I would not need it, when I decided to try monogame. I didn’t know DigitalRune would pop into my view.
Always trying out things. :grin:

Thanks for your responses guys.

Realized my system was acting strangely - keys sticking, mouse lagging…, so I did a full scan, and it turns out protobuild.exe from the protobuild-manager is also malware ( …AppData\Roaming.protobuild-manager\Protobuild.exe)
So Protobuild.exe is dangerous, period. Do not use Protobuild at all