EzDevInfo.com

mono interview questions

Top mono frequently asked interview questions

Running ASP.Net on a Linux based server

For a developer with a Java background, I am interested in exploring software development using the ASP.NET tools/platform as well.

Java web applications (.jsp and servlets) can run on many server platforms.

Question: Will a .NET web application be able to run in a Linux based server? Considering the scenario of not being able to use a Windows server for hosting a web app.


Source: (StackOverflow)

.Net (dotNet) wrappers for OpenCV?

I've seen there are a few of them. opencvdotnet, SharperCV, EmguCV, One on Code Project.

Does anyone have any experience with any of these? I played around with the one on Code Project for a bit, but as soon as I tried to do anything complicated I got some nasty uncatchable exceptions (i.e. Msgbox exceptions). Cross platform (supports Mono) would be best.


Source: (StackOverflow)

Advertisements

How can I launch multiple instances of MonoDevelop on the Mac?

I would like to open a new MonoDevelop instance to work on a different project on the Mac, and the OS is currently preventing me from opening a new instance.


Source: (StackOverflow)

How to decide between MonoTouch and Objective-C?

After sitting through a session today on Mono at a local .Net event, the use of MonoTouch was 'touched' upon as an alternative for iPhone development. Being very comfortable in C# and .Net, it seems like an appealing option, despite some of the quirkiness of the Mono stack. However, since MonoTouch costs $400, I'm somewhat torn on if this is the way to go for iPhone development.

Anyone have an experience developing with MonoTouch and Objective-C, and if so is developing with MonoTouch that much simpler and quicker than learning Objective-C, and in turn worth the $400?


Source: (StackOverflow)

Most useful NLog configurations [closed]

What are the best or most useful configurations for logging with NLog? (These can be simple or complex, as long as they're useful.)

I'm thinking of examples like automatically rolling over log files at a certain size, changing the layout (log message) whether or not there is an exception, escalating the log level once an error has occurred, etc.

Here are some links:


Source: (StackOverflow)

Is Mono ready for prime time? [closed]

Has anyone used Mono, the open source .NET implementation on a large or medium sized project? I'm wondering if it's ready for real world, production environments. Is it stable, fast, compatible, ... enough to use? Does it take a lot of effort to port projects to the Mono runtime, or is it really, really compatible enough to just take of and run already written code for Microsoft's runtime?


Source: (StackOverflow)

Encrypt and decrypt a string

Can someone give me the code to encrypt and decrypt a string in C#?


Source: (StackOverflow)

What is the best way to run ServiceStack on Linux / Mono?

Listed on the ServiceStack website it shows that ServiceStack can run on Mono with either:

  • XSP
  • mod_mono
  • FastCgi
  • Console

What are these different configurations and which is preferred for Web Services on Mono?


Source: (StackOverflow)

Does .NET have a way to check if List a contains all items in List b?

I have the following method:

namespace ListHelper
{
    public class ListHelper<T>
    {
        public static bool ContainsAllItems(List<T> a, List<T> b)
        {
            return b.TrueForAll(delegate(T t)
            {
                return a.Contains(t);
            });
        }
    }
}

The purpose of which is to determine if a List contains all the elements of another list. It would appear to me that something like this would be built into .NET already, is that the case and am I duplicating functionality?

Edit: My apologies for not stating up front that I'm using this code on Mono version 2.4.2.


Source: (StackOverflow)

Graph database for .NET [closed]

I've been designing an application, based on .NET/Mono framework, which should make an heavy use of the shortest-path in a graph theories and I would like to use a native solution to traverse the nodes of the graph, instead of implementing surrogate solutions which would be hardly maintainable and would massively affect performances.

I've found an application which would be perfect for my scope: neo4j.

Unfortunately, this application is purely written in Java code and it's not portable to .NET, because of the massive differences between the two architectures.

Is anyone out there knows if is it there any port of neo4j or a similar solution for .NET?


Source: (StackOverflow)

How do I code a Mono Daemon

I'm trying to write a Mono C# daemon for linux.

I'd like to do a starts and stops of it when its done processing instead of just killing the process.

Does anyone have any examples of this?

Edit: I figured out how to use start-stop-daemon --background in debian, so I think I'll just use that for now.

Edit: I'm implementing this in java as well and they have this nice addShutdownHook that catches terminating the app. I need to spend a little more time sorting out the dependencies for mono service, or find a way to catch app termination.

There is the SessionEnd event, but thats only available for services and not console apps

Answer: using mono-service to wrap a windows service on linux


Source: (StackOverflow)

Is Roslyn Cross Platform?

I've been looking at Roslyn for quite some time now, and I'm curious and excited about it. One thing I noticed is that they mentioned that the compiler is re-written in managed code. This raises the question of whether Roslyn is able to run on non-.NET virtual machines, such as Mono.

I would really love to embed C# scripting using Roslyn in my video games, and to use many of their other features in my applications, but I'm wondering if using Roslyn will break the ability for it to run on Mono.

Has anyone tried running Roslyn on Mono? Is it possible? Why or why not?

To clarify, I'm interested in both whether the managed assembly can run on mono, and whether it can generate assemblies that mono can run.


Source: (StackOverflow)

Unable to run .net app with Mono - mscorlib.dll not found (version mismatch?)

I have a simple .net command line tool written and compiled under Windows, using .net 3.5SP1. I would like to run it on Linux using Mono.

I am using Ubuntu 12.04, and installed Mono Runtime using the Ubuntu software center. If I try to start my app in the terminal by doing:

mono MyApp.exe

I get the error:

The assembly mscorlib.dll was not found or could not be loaded. It should have been installed in the 'usr/lib/mono/2.0/mscorlib.dll'.

If I navigate to that location, I see that it does not exist. However, there is usr/lib/mono/4.0/mscorlib.dll (and some more DLLs in the same folder).

So seemingly there is a version mismatch.

[in case it matters, mono -V shows Mono JIT compiler version 2.10.8.1 (Debia 2.10.8.1-1ubuntu2) ]


Source: (StackOverflow)

Interlocked and volatile

I have a variable which I am using to represent state. It can be read and written to from multiple threads.

I am using Interlocked.Exchange and Interlocked.CompareExchange to change it. However I am reading it from multiple threads.

I know that volatile can be used to make sure the variable is not cached locally but always reads directly from memory.

However if I set the variable to volatile then it generates a warning about using volatile and passing using ref to the Interlocked methods.

I want to ensure that each thread is reading the most recent value of the variable and not some cached version, but I can't use volatile.

There is a Interlocked.Read but it is for 64 bit types and is not available on the compact framework. The documentation for it says that it is not needed for 32 bit types as they are already performed in a single operation.

There are statements made across the internet that you don't need volatile if you are using the Interlocked methods for all your access. However you can't read a 32 bit variable using the Interlocked methods, so there is no way you can use Interlocked methods for all your access.

Is there some way to accomplish the thread safe read and write of my variable without using lock?


Source: (StackOverflow)

Installing Mono 3.x

I've recently read that Mono 3.0 has been released with a C# 5 compiler and support for MVC 4 here:

http://www.mono-project.com/Release_Notes_Mono_3.0

and

http://tirania.org/blog/archive/2012/Oct-22.html

For the life of me I cannot work out where to get it from as a package for Linux or even Windows.

This page seems to suggest it's still in Beta:

http://www.go-mono.com/mono-downloads/download.html

I've tried doing a apt-get install mono-complete on Ubuntu 12.10 but it's installed 2.10.8.1.

I've tried installing MonoDevelop 3 on my Windows machine and that's only presented me with MVC 3 projects and appears to be using the .NET framework.

I'm entirely new to Mono and I've Googled everything possible to try and see how this works but am baffled. I'd love to get this working on Linux if possible and try some stuff out.

Can someone shed some light on this or do I need to be looking at building this from source?


Source: (StackOverflow)