m1gin 1570

Running ASPX project developed in VB.NET on Mono 5+ gives some errors.

error VBNC30248: CHANGEME
Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
Details: error VBNC30248: CHANGEME
Error origin: Compiler
Error source file: /tmp/www-data-temp-aspnet-0/b95b1af2/App_Web_MenuBH.ascx.fd7eef68.7vxof078_1.vb
Exception stack trace:

I tried some suggestions from https://github.com/mono/mono-basic/issues/52 but didn't work.

I edited the file /usr/bin/vbnc as follow and it started to WORK!

BEFORE Editing:

exec /usr/bin/mono --debug $MONO_OPTIONS /usr/lib/mono/4.5/vbnc.exe "$@"

AFTER Editing:


for x; do
if [[ $x = '/tmp'* ]]; then
sed -i '1{/#Externa/d}' $x

exec /usr/bin/mono /usr/lib/mono/4.5/vbnc.exe "$@"

Tested on Ubuntu 20.04 with Mono

Fixing UTF-8 Encodings Problems

With the above fixing method, I realized that Turkish characters in .ascx and aspx files shown as question mark (?) on the site.

I think this happens because of the first line (and first bytes) of the file removed by sed, and thus the UTF-8 encoding information of the file is lost.

Solution 1:

Specifying /codepage parameter for vbnc.exe in the file /usr/bin/vbnc fixed the problem for me. For UTF-8, codepage id is 65001.


find /tmp -iname "*.vb" | while read f; do
sed -i '1{/#Externa/d}' $f;

exec /usr/bin/mono --debug $MONO_OPTIONS /usr/lib/mono/4.5/vbnc.exe /codepage:65001 "$@"

Solution 2:

Another possible solution is should be commenting the first line, instead of removing it completely.


find /tmp -iname "*.vb" | while read f; do
sed -i "1 s|#ExternalChecksum|'#ExternalChecksum|" "$f"

exec /usr/bin/mono --debug $MONO_OPTIONS /usr/lib/mono/4.5/vbnc.exe "$@"

To examine the effected files, I went to a location like: /tmp/systemd-private-3bd056c36fda4632a0cd170469bbc343-apache2.service-MpcOti/tmp/www-data-temp-aspnet-0/

m1gin 0

2018-05: Eski versiyon Mono kurulumu:

Mono 5.10 ile nedense derlenmiş VB projeleri sorun çıkardı. Ve şuna benzer hata mesajları verdi:


error VBNC30248: CHANGEME

O yüzden eski versiyon (4.6.2) kurulararak sorun çözüldü.

  • nano /etc/apt/sources.list.d/mono-official-stable.list

Dosya düzenlendi ve içeriği şu şekilde değiştirildi:

deb https://download.mono-project.com/repo/ubuntu wheezy/snapshots/4.6.2 main

Ancak bu defa da libapache2-mod-mono paketi kurulamadı ve daha eski versiyon apache istendi. Bunun üzerine bu paket sona bırakıldı ve en son dosya şu şekilde düzenlendi:

nano /etc/apt/sources.list.d/mono-official-stable.list

deb https://download.mono-project.com/repo/ubuntu stable-xenial main

Mono Tips

Create dll library with Mono:

For vb.net codes: vbnc, vbnc2
For c# classes: mcs

  • vbnc2 -target:library -imports:System.Text -r:bin/mbLib.dll -imports:System.Web -out:test.dll Ads.vb Custom.vb Common.vb DBTables.vb


In some cases, If mod-mono-server2 is called instead of mod-mono-server4, a symbolic link can be useful.

ln -s /usr/bin/mod-mono-server4 /usr/bin/mod-mono-server2



Could not load file or assembly 'Microsoft.VisualBasic, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.


yay -S mono-basic

Add to: