1
votes

I tried to build MonoDevelop 7.2.x on Windows 10 using Visual Studio 2017 and unfortunately had some problems.

I followed the instruction on the official homepage (http://www.monodevelop.com/developers/building-monodevelop/) and installed all the required dependencies.

I downloaded the release zip file (https://github.com/mono/monodevelop/archive/monodevelop-7.2.0.583.zip) and extracted it.

I opened the Main.sln Visual Studio solution and tried to build, unfortunately VS complained about a lot of missing references or things that could not be found like "The type or namespace name 'NRefactory' does not exist in the namespace 'ICSharpCode'".

I also tried the winbuild.bat using a git cloned repository. This also did not work because of an unsupported command line switch given to MSBuild.

Has anyone here been able to build MonoDevelop 7.x on Windows successfully? And if yes, how?

2>F:\Development\monodevelop-monodevelop-7.2.0.583\main\contrib\ICSharpCode.Decompiler\Ast\Annotations.cs(5,19,5,29): error CS0234: The type or namespace name 'NRefactory' does not exist in the namespace 'ICSharpCode' (are you missing an assembly reference?)
2>F:\Development\monodevelop-monodevelop-7.2.0.583\main\contrib\ICSharpCode.Decompiler\Ast\AstBuilder.cs(33,19,33,29): error CS0234: The type or namespace name 'NRefactory' does not exist in the namespace 'ICSharpCode' (are you missing an assembly reference?)
2>F:\Development\monodevelop-monodevelop-7.2.0.583\main\contrib\ICSharpCode.Decompiler\Ast\AstBuilder.cs(34,19,34,29): error CS0234: The type or namespace name 'NRefactory' does not exist in the namespace 'ICSharpCode' (are you missing an assembly reference?)
2>F:\Development\monodevelop-monodevelop-7.2.0.583\main\contrib\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs(28,19,28,29): error CS0234: The type or namespace name 'NRefactory' does not exist in the namespace 'ICSharpCode' (are you missing an assembly reference?)
2>F:\Development\monodevelop-monodevelop-7.2.0.583\main\contrib\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs(29,19,29,29): error CS0234: The type or namespace name 'NRefactory' does not exist in the namespace 'ICSharpCode' (are you missing an assembly reference?)
2>F:\Development\monodevelop-monodevelop-7.2.0.583\main\contrib\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs(30,19,30,29): error CS0234: The type or namespace name 'NRefactory' does not exist in the namespace 'ICSharpCode' (are you missing an assembly reference?)

Here is the complete build log: https://pastebin.com/p6c8miC9

2
The errors look like you did not initialize the external submodules. You should try running git submodule update --init --recursive from the root of the GitHub repository where you checked it out.Matt Ward
Unfortunately that is not the problem. I did a submodule init recursive.trenki
OK - the pastebin link has an error about the NRefactory project being missing The referenced project '..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj'. However the decompiler project does not use that but has a NuGet package reference - so maybe you need to run a nuget restore for the Main.sln.Matt Ward
Future readers might refer to the official guide monodevelop.com/developers/building-monodevelop or refer to my repo github.com/lextm/monodevelop-windows to see an illustration on how to compile the code. The 7.8 branch should work in most cases, while the 8.x branches might still have some issues.Lex Li

2 Answers

2
votes

I know it's really late, but in case anyone's having similar issues, here's how I managed to build it.

In your case it seems like the problem is that you are missing the submodules in that repo. You'll have to clone using the --recursiveargument. The old monodevelop build instruction page incorrectly showed this as -recursive(missing one hyphen) and it is still missing some extra info.

To successfully build monodevelop, first you'll have to download the install the latest version of Visual Studio 2017 and install pretty much everything under Universal Windows Platform development, .NET desktop development, and .NET Core cross-platform development workloads. Then build it using winbuild.bat. I couldn't make a build with the Visual Studio IDE.

Hope this helps.

2
votes

I came across this problem on Windows 10 using MonoDevelop Version 7.7 Preview (7.7) also. Ultimately I discarded all of the previously downloaded folders and files then re-downloaded them fresh using

git clone https://github.com/mono/monodevelop --recursive

as I did before. As an experiment, I ran Visual Studio 2017's winbuild.bat in an Open Mono x86 Command Prompt as Administrator. I cannot state absolutely that this is the fix, however. It just worked for me.