I
I
Ilya2016-11-29 13:53:55
linux
Ilya, 2016-11-29 13:53:55

How to compile c# project in dotnet?

I'm trying to compile the project https://github.com/yar229/WebDavMailRuCloud in debian, but nothing happens. The first time I ran into this, I tried to run a ready-made exe through mono, a lot of errors did not work either. How to do it better?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Nemiro, 2016-11-29
@nuBacuk

# клонируем рекурсивно, т.к. там ссылка на другой репозиторий
git clone --recursive https://github.com/yar229/WebDavMailRuCloud.git
# тянем последнюю версию nuget, если таковой еще нет
wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -O nuget.exe --no-check-certificate
# восстанавливаем пакеты nuget
mono nuget.exe restore WebDavMailRuCloud/WebDAVMailRuCloud.sln
# пробуем выполнить сборку решения
MONO_IOMAP=case xbuild WebDavMailRuCloud/WebDAVMailRuCloud.sln

If we get an error:
Here is this line:
https://github.com/yar229/Mail.Ru-.net-cloud-clien...
Open a local copy of the specified file and add brackets (by the way, you can make a pull request ):
Try to build again:
If successful, we get something like this:
18 Warning(s)
0 Error(s)

Let's try to run:
We get:
log4net:ERROR Could not create Appender [ColoredConsoleAppender] of type [log4net.Appender.ColoredConsoleAppender]. Reported error follows.
System.EntryPointNotFoundException: GetConsoleOutputCP
...

I will not delve into the essence, but it is obvious that there is some kind of problem with log4net . You can just disable log4net . Open the configuration file:
Replace the <log4net>...</log4net> branch with:
It started up normally with the --help parameter , I didn’t look further:
mono WebDavMailRuCloud/WDMRC.Console/bin/Debug/wdmrc.exe --help
WebDAVCloudMailRu 1.0.0.0
[email protected]

  -p, --port        Required. WebDAV server port

  -l, --login       Required. Login to Mail.ru Cloud

  -s, --password    Required. Password to Mail.ru Cloud

  --maxthreads      (Default: 5) Maximum concurrent connections to cloud.mail.ru

  --user-agent      "browser" user-agent

  --help            Display this help screen.

  --version         Display version information.

UPD: I tried to run with login and password , got an error like:
Unhandled Exception:
System.InvalidOperationException: Property 'enabled' not found in configuration element
at System.Configuration.ConfigurationElement.get_Item (System.String property_name) <0xb50f5608 + 0x000a7> in :0
at System.Configuration.ConfigurationElement.get_Item (System.Configuration .ConfigurationProperty property) <0xb50f55d8 + 0x0001f> in :0
at System.Net.Configuration.DefaultProxySection.get_Enabled () <0xb506a270 + 0x0001b> in :0
at MailRuCloudApi.Account.Login () <0xb50699f8 + 0x000af> in :0

The problem is getting the default proxy values:
https://github.com/yar229/Mail.Ru-.net-cloud-clien...
In theory, the default proxy server can be disabled/configured in the application configuration file, by adding something like this to the configuration section:
<system.net>
  <defaultProxy enabled="false" useDefaultCredentials="false">
    <proxy/>
    <bypasslist/>
    <module/>
  </defaultProxy>
</system.net>

But for some reason it didn't work for me. You can remove the specified lines ( if (new DefaultProxySection().Enabled)... ) from the file and build the solution again:
nano WebDavMailRuCloud/MailRuNetCloudClient/MailRuCloudApi/Account.cs
MONO_IOMAP=case xbuild WebDavMailRuCloud/WebDAVMailRuCloud.sln

With login and password it started:
If logging ( log4net ) and proxy is required, then I will have to understand these problems in more depth.
-------------------------------------------------- ----------------------------
The following people took part in the test:
  • Debian v8.1
  • Mono v4.2.3
  • XBuild Engine v12.0
  • Nuget v3.4.4.1321

G
GavriKos, 2016-11-29
@GavriKos

So, how did you try to compile? Commands + exhaust bring here.

Y
yar229, 2017-02-02
@yar229

wdmrc-mono-*.tar.gz
Tested under Elementary OS and Lubuntu sudo apt install apt mono-completeand works
Building with https://travis-ci.com/
Discussed here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question