Ubuntu Question2: C# development

bchip

Senior Member
Joined
Mar 12, 2013
Messages
854
So next question on Ubuntu.

I've been using VS Community for a while, works great I'm use to it no problems.
I'm working on a project that creates a couple of DLL's that has code that I can simply reference,
dont have to rewrite it all over and over again.

I've copied the solution over from Win10 and started using Monodev to edit.
From my understanding Monodev is the only that has a GUI editor...only to find out its a GTK editor,
and does not support any Windows Forms.

So I've tried to rewrite the project quickly only to find another issue.
Everytime I reference my DLL's the whole project just crashes. I eventually was able to get this error:

/usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(5,5): Warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190. (MSB3276)

The link given by MonoDev shows how to fix the error in MS Visual Studios community...
I have absolutely no idea how to fix this here.

Any help would really be appreciated.
 

bchip

Senior Member
Joined
Mar 12, 2013
Messages
854
I've also noticed this warning:

The following packages should be retargeted. They were installed with a target framework that is different from the current project target framework '.NETFramework,Version=v4.6'. The packages contain assembly references or content files for the current project target framework which are not currently installed.

System.Runtime.CompilerServices.Unsafe
System.Threading.Tasks.Extensions
System.ValueTuple
 

bchip

Senior Member
Joined
Mar 12, 2013
Messages
854
I've also realized that this is whats really the root problem on this:

Type xmlType = Type.GetTypeFromProgID("Microsoft.XMLHTTP");
dynamic oXMLHTTP = Activator.CreateInstance(xmlType);


Old code that I need to replace...
This does not work in the Linux environment.
 

bchip

Senior Member
Joined
Mar 12, 2013
Messages
854
Resolved:

My work around was just to replace the references, although I'm still not sure how to recompile
to the correct versions.


Above code referring to Microsoft packages was replaced with something inline with:
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("http://example.com/");
client.DefaultRequestHeaders
.Accept
.Add(new MediaTypeWithQualityHeaderValue("application/json"));//ACCEPT header

HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "relativeAddress");
request.Content = new StringContent("{\"name\":\"John Doe\",\"age\":33}",
Encoding.UTF8,
"application/json");//CONTENT-TYPE header

client.SendAsync(request)
.ContinueWith(responseTask =>
{
Console.WriteLine("Response: {0}", responseTask.Result);
});
 

_kabal_

Expert Member
Joined
Oct 24, 2005
Messages
2,710
Why bother with mono? Just use dotnet core instead.

For IDE/Editor use visual studio code, or IntelliJ rider
 

bchip

Senior Member
Joined
Mar 12, 2013
Messages
854
Why bother with mono? Just use dotnet core instead.

For IDE/Editor use visual studio code, or IntelliJ rider
IntelliJ Rider costs $140 / R 2,000 per year.

Visual Studio code couldnt open a solution, nevermind the GUI editor.
(Not sure if I'm doing something wrong there, cause that seems weird)
 

maven682

Member
Joined
Apr 2, 2015
Messages
13
IntelliJ Rider costs $140 / R 2,000 per year.

Visual Studio code couldnt open a solution, nevermind the GUI editor.
(Not sure if I'm doing something wrong there, cause that seems weird)
Wpf not supported in dot net core. You can find an add-on to load sln files.
 

maven682

Member
Joined
Apr 2, 2015
Messages
13
Thanks, needed a good laugh. .net core 3.0 will bring support for WPF. Its already in the release channels.
I also got a good laugh thanks. The OP is working in Linux. Read the fine-print. WPF support is for Windows desktops only.
 
Top