Showing posts with label monodevelop. Show all posts
Showing posts with label monodevelop. Show all posts

Sunday, January 03, 2021

error : Your project does not reference ".NETFramework,Version=v4.7.2" framework

I am trying to have a solution/project that can be built using Visual Studio 2019, MonoDevelop and dotnet. Building the project using mono (msbuild project.csproj) after building using dotnet I am getting the error message below.  

 

Build started 1/3/2021 1:41:21 AM.
Project "/home/u1/gitprj/mopcua/MonoOPC/opcuac/opcuac.csproj" on node 1 (default targets).
/usr/lib/mono/xbuild/Microsoft/NuGet/Microsoft.NuGet.targets(186,5): error : Your project does not reference ".NETFramework,Version=v4.7.2" framework. Add a reference to ".NETFramework,Version=v4.7.2" in th$
 "TargetFrameworks" property of your project file and then re-run NuGet restore. [/home/u1/gitprj/mopcua/MonoOPC/opcuac/opcuac.csproj]
Done Building Project "/home/u1/gitprj/mopcua/MonoOPC/opcuac/opcuac.csproj" (default targets) -- FAILED.

Build FAILED.

"/home/u1/gitprj/mopcua/MonoOPC/opcuac/opcuac.csproj" (default target) (1) ->
(ResolveNuGetPackageAssets target) ->
  /usr/lib/mono/xbuild/Microsoft/NuGet/Microsoft.NuGet.targets(186,5): error : Your project does not reference ".NETFramework,Version=v4.7.2" framework. Add a reference to ".NETFramework,Version=v4.7.2" in $
he "TargetFrameworks" property of your project file and then re-run NuGet restore. [/home/u1/gitprj/mopcua/MonoOPC/opcuac/opcuac.csproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.04
 

Workaround was to delete <project>/obj/project.assets.json and then rebuild. 

Reference:

https://stackoverflow.com/questions/52833741/your-project-does-not-reference-netframework-version-v4-6-2-framework-add-a


Wednesday, December 23, 2020

Getting "Native error= Cannot find the specified file" when running a console app in MonoDevelop

On Ubuntu 20.10 with MonoDevelop 7.8.4 build (2), running a console application generates the following error message: 

ApplicationName='/usr/lib/gnome-terminal/gnome-terminal-server', CommandLine='--app-id mono.develop.id5647740ca7f5455da9c27ab2c320a029', CurrentDirectory='', Native error= Cannot find the specified file

 

To fix this do:

$: sudo mkdir /usr/lib/gnome-terminal
$: cd /usr/lib/gnome-terminal
$: sudo ln -s /usr/libexec/gnome-terminal-server

 

Reference: https://stackoverflow.com/questions/59336129/error-when-trying-to-run-code-debugger-operation-failed-native-error-cannot-f

Tuesday, December 22, 2020

Installing MonoDevelop on Ubuntu 20.04

 To install MonoDevelop on Ubuntu 20.04/20.10, do:

$: sudo apt install apt-transport-https dirmngr
$: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
$: echo "deb https://download.mono-project.com/repo/ubuntu vs-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-vs.list
$: sudo apt update
$: sudo apt-get install monodevelop
$: echo "deb https://download.mono-project.com/repo/ubuntu vs-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-vs.list
$: sudo apt update
$: sudo apt upgrade

Note that:
  • As of this writing (12/22/2020) https://www.monodevelop.com/download/ only shows support for Ubuntu 18.04
  • I have only tested this on very simple application - console and Gtk2 dialog app
  • You will notice that I started installing using Bionic (Ubuntu 18.04) and then changed to Focal (Ubuntu 20.04) to upgrade all the libraries
  • This applies to Pop!_OS 20.10

Friday, January 22, 2016

The type or namespace name `Gtk' could not be found. Are you missing an assembly reference?

After fixing items below related to MonoDevelop on Linux Mint 7.3, another error shows up:
http://8thstring.blogspot.com/2016/01/monodevelop-does-not-start-on-linux.html
http://8thstring.blogspot.com/2016/01/could-not-obtain-c-compiler-c-compiler.html

The type or namespace name `Gtk' could not be found. Are you missing an assembly reference?

To fix install gtk-sharp-2.0 libraries, like:
$: sudo apt-get install gtk-sharp2


Thursday, January 21, 2016

Could not obtain a C# compiler. C# compiler not found for Mono / .Net 4.0

Tried to build a monodevelop project in Linux Mint 17.3 but got the following error message

Could not obtain a C# compiler. C# compiler not found for Mono / .Net 4.0
To fix this do:
$: sudo apt-get install mono-gmcs

Reference(s):
http://stackoverflow.com/questions/8022653/c-sharp-compiler-not-found-when-building-a-package-monodevelop-linux

Monodevelop does not start on Linux Mint 7.3

This is issue is similar to this one but different dependencies. So, I have installed monodevelop like:
$: sudo apt-get install monodevelop
Unfortunately it is not working. Need to install the following dependencies to make it to work
$: sudo apt-get install libmono-cairo2.0-cil

CPP Quick Guide

Basics Hello world User input While loop If statement For loop Switch statement Read file using ifstream Write to a file using ofstr...