Mono support for Castle Core

90 views
Skip to first unread message

Jonathon Rossi

unread,
Dec 28, 2014, 11:39:54 PM12/28/14
to Castle Project Development, m...@harimenon.com
I've attempted to get our build running on Mono 3.10 on both OSX and Ubuntu. I've got things working on OSX, but am getting the following error on Ubuntu on our new Ubuntu TeamCity agent:

Missing method .ctor in assembly /home/teamcity/buildagent/work/16de7b8c88ab14af/lib/net45/NLog.dll, type System.Runtime.CompilerServices.ExtensionAttribute
Can't find custom attr constructor image: /home/teamcity/buildagent/work/16de7b8c88ab14af/lib/net45/NLog.dll mtoken: 0x0a000018

http://builds.castleproject.org/viewType.html?buildTypeId=Core_MasterMono310

I've read mentions that this type of error is caused by the fact ExtensionAttribute moved assembly between .NET 4.0 and 4.5 via a TypeForwardedTo, but I'm trying to avoid building log4net, NLog and Serilog from source in our build. Anyone got any ideas?

The plan is to get this working so that I can add a unit test for https://github.com/castleproject/Core/issues/72.

--
Jono

Hari Menon

unread,
Jan 2, 2015, 10:37:20 AM1/2/15
to castle-pro...@googlegroups.com
You might have already seen this answer on Stack Overflow - they seem to have success with Mono 3.2.8.

What is the version of Ubuntu and Mono running on the Ubuntu agent on the CI server?

It looks like the latest Mono available as Ubuntu packages are for 3.2.8 - but since the build configuration is named Master - Mono 3.10, I am guessing we are building Mono 3.10 ourselves.

Thanks

Jonathon Rossi

unread,
Jan 4, 2015, 2:28:49 AM1/4/15
to Castle Project Development
Yes, I think I saw that one and that they haven't had problems with any recent Mono version.

The agent is a fresh install, I set it up in December with Ubuntu 14.04 and installed Mono 3.10 as per these instructions:

$ mono --version
Mono JIT compiler version 3.10.0 (tarball Wed Nov  5 12:50:04 UTC 2014)

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-d...@googlegroups.com.
To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

Hari Menon

unread,
Jun 12, 2015, 4:44:09 PM6/12/15
to castle-pro...@googlegroups.com
I would like to try and reproduce this at my end - could you please let me know how the 'xbuild' looked for you along with the arguments on both Mac and Linux?

On Sunday, January 4, 2015 at 2:28:49 AM UTC-5, Jonathon Rossi wrote:
Yes, I think I saw that one and that they haven't had problems with any recent Mono version.

The agent is a fresh install, I set it up in December with Ubuntu 14.04 and installed Mono 3.10 as per these instructions:

$ mono --version
Mono JIT compiler version 3.10.0 (tarball Wed Nov  5 12:50:04 UTC 2014)
On Sat, Jan 3, 2015 at 1:37 AM, Hari Menon <hari...@gmail.com> wrote:
You might have already seen this answer on Stack Overflow - they seem to have success with Mono 3.2.8.

What is the version of Ubuntu and Mono running on the Ubuntu agent on the CI server?

It looks like the latest Mono available as Ubuntu packages are for 3.2.8 - but since the build configuration is named Master - Mono 3.10, I am guessing we are building Mono 3.10 ourselves.

Thanks


On Sunday, December 28, 2014 11:39:54 PM UTC-5, Jonathon Rossi wrote:
I've attempted to get our build running on Mono 3.10 on both OSX and Ubuntu. I've got things working on OSX, but am getting the following error on Ubuntu on our new Ubuntu TeamCity agent:

Missing method .ctor in assembly /home/teamcity/buildagent/work/16de7b8c88ab14af/lib/net45/NLog.dll, type System.Runtime.CompilerServices.ExtensionAttribute
Can't find custom attr constructor image: /home/teamcity/buildagent/work/16de7b8c88ab14af/lib/net45/NLog.dll mtoken: 0x0a000018

http://builds.castleproject.org/viewType.html?buildTypeId=Core_MasterMono310

I've read mentions that this type of error is caused by the fact ExtensionAttribute moved assembly between .NET 4.0 and 4.5 via a TypeForwardedTo, but I'm trying to avoid building log4net, NLog and Serilog from source in our build. Anyone got any ideas?

The plan is to get this working so that I can add a unit test for https://github.com/castleproject/Core/issues/72.

--
Jono

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-devel+unsub...@googlegroups.com.

To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

Jonathon Rossi

unread,
Jun 16, 2015, 12:34:59 AM6/16/15
to Castle Project Development
Sorry for the delay in getting back to you, I wanted to upgrade Mono from 3.10 to 4.0.1 to see if the issue had been resolved.

After upgrading to Mono 4.0.1 the MSBuildCommunityTasks wouldn't work anymore because Mono 4 removed the old 2.x assemblies which allows it to work. I removed the use of those tasks in this branch:

This is the command that I'm running:
xbuild /p:Configuration=NET45-Release /t:RunAllTests buildscripts/Build.proj

It works well on OSX without any errors (and without those "Can't find custom attr constructor image" ones from earlier), I get to the point of having heaps of unit tests failing, but that is fine I want to go through all the conditional compilation and fix them for today's mono not from mono 5 years ago.

I upgraded the castle CI mono agent to 4.0.1 and get some strange compile errors where it can't find types from mscorlib.dll but only when building the SerilogIntegration project, not sure what is different about it. Running it on the machine it specifies /nostdlib but sometimes doesn't reference an mscorlib.dll assembly. Looking at the run from TeamCity seems to still have the "Can't find custom attr constructor image" error.


Do you get these errors on Linux, if not I'll look at rebuilding our CI agent.

To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-d...@googlegroups.com.
To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-d...@googlegroups.com.

To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

Hari Menon

unread,
Jun 19, 2015, 10:30:19 AM6/19/15
to castle-pro...@googlegroups.com
Thank you - I was trying to build the configuration named "MONO310-Release"

With Mono 4.0.1, I can also build on Mac (and it fails when running the tests). But on Ubuntu, I am getting a different error:
(BuildProject target) ->
: error : Error initializing task RegexMatch: Could not load file or assembly 'Microsoft.Build.Utilities, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

This is the version of Ubuntu I have:
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-devel+unsub...@googlegroups.com.
To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-devel+unsub...@googlegroups.com.

To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

Jonathon Rossi

unread,
Jun 19, 2015, 10:33:43 AM6/19/15
to Castle Project Development
I was also using the MONO310-Release configuration earlier (months ago) to just get stuff going, but also got things going with NET45-Release so kept going with it as we shouldn't need a separate configuration, I do intend to remove anything Mono specific I can.

Did you use the mono-support branch I mentioned above? As I mentioned MSBuildCommunityTasks isn't working anymore because the MSBuild 2.0.0.0 assemblies were removed from Mono 4.x, so I've removed them in that branch.

To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-d...@googlegroups.com.
To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-d...@googlegroups.com.

To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-d...@googlegroups.com.

To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

Hari Menon

unread,
Jun 19, 2015, 12:56:29 PM6/19/15
to castle-pro...@googlegroups.com
Ah, my bad. I did switch to mono-support on the Mac, but was still trying it out on the master branch from the Ubuntu VM.

It looks like that latest on mono-support branch does compile with mono 4.0.1 on the Ubuntu and is failing on the unit tests (like the Mac build).

Here is my build log on Ubuntu: http://paste.ubuntu.com/11741152/
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-devel+unsub...@googlegroups.com.
To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-devel+unsub...@googlegroups.com.

To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-devel+unsub...@googlegroups.com.

To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

Jonathon Rossi

unread,
Jun 22, 2015, 9:38:46 AM6/22/15
to Castle Project Development
I've posted some updates in:
https://github.com/castleproject/Core/issues/79

Thanks

To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-d...@googlegroups.com.
To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-d...@googlegroups.com.

To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-d...@googlegroups.com.

To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-d...@googlegroups.com.

To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono

Hari Menon

unread,
Jun 27, 2015, 1:02:35 PM6/27/15
to castle-pro...@googlegroups.com
Jono - have you seen any line endings issue especially when seeing the diff from Mac or Linux?

I was looking into adding some more options into the '.editorconfig' and this thread on stackoverflow was a good read - http://stackoverflow.com/questions/170961/whats-the-best-crlf-carriage-return-line-feed-handling-strategy-with-git

What are your thoughts?

Jonathon Rossi

unread,
Jun 28, 2015, 11:26:34 PM6/28/15
to Castle Project Development
Not since I added a .gitattributes file to the mono-support branch (which I just merged to master).

It isn't the .gitattributes set up I'd like, but it is basically the same as Windsor's and means I don't need to normalise all the line endings in the Git object database at the moment. In the future we'll probably want to normalise the line endings to LF, but I didn't want to make that change with many open PRs.

Personally I think Git should manage line endings and not editorconfig, unless we are going with LF in all files on all platforms. I think VS still rewrites certain files with CRLF even if they only had LFs, IIRC solution files and generated cs files like Resources.Designer.cs.

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-d...@googlegroups.com.
To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.

-- 
Jono

Oskar Berggren

unread,
Jun 29, 2015, 6:45:09 AM6/29/15
to castle-pro...@googlegroups.com


2015-06-29 4:26 GMT+01:00 Jonathon Rossi <jo...@jonorossi.com>:

Personally I think Git should manage line endings and not editorconfig, unless we are going with LF in all files on all platforms. I think VS still rewrites certain files with CRLF even if they only had LFs, IIRC solution files and generated cs files like Resources.Designer.cs.


Having dealt the line-ending setup for the NHibernate project etc. it's my experiance also that Visual Studio cannot be trusted. While its editor appears to detect and respect consistent line endings of a certain type, this seems to be unreliable. The issue might be that certain plugins (e.g. Resharper) might insert CRLF even if the file is otherwise LF. In NHibernate we eventually settled on having GIT normalize to LF in repo and native on checkout.

/Oskar


Hari Menon

unread,
Jun 29, 2015, 12:22:18 PM6/29/15
to castle-pro...@googlegroups.com
Sounds good - then we might not have anything more to add to the current version of the '.editorconfig' file.

Jono - could you have inadvertently removed the '.gitattributes' file before committing?

Jonathon Rossi

unread,
Jun 29, 2015, 12:30:56 PM6/29/15
to Castle Project Development
Hmmm, now that I think about it I did have one committed and it was causing me problems so I rebased it out.

Currently my core.autocrlf setting is unset which allowed things to just work, however it isn't a solution.

Once we get through the current open PRs I think we just need to bite the bullet and do the right thing and normalise the git object db, I've had no problems with repos working that way.

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to castle-project-d...@googlegroups.com.
To post to this group, send email to castle-pro...@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-devel.
For more options, visit https://groups.google.com/d/optout.



--
Jono
Reply all
Reply to author
Forward
0 new messages