C# and MonoDevelop on Ubuntu - missing system libraries contents - c#

I wanted to make a use of Mono on Ubuntu 14.04.3 LTS in order to write some client-server app using C# language.
I followed this tutorial and installed everything Mono needs to be compiling and running C# .NET apps on Ubuntu.
Then I installed MonoDevelop 5.9.6 according to this tutorial which was actually installing three packages: monodevelop, l monodevelop-nunit, monodevelop-versioncontrol (I skipped database package as I don't need it for now).
I created simple console application in MonoDevelop and now I am trying to use some code which referencen to System.Net.Sockets (and other) system library class. I added to my project's references the System.Net.dll, which is located under usr/lib/mono/4.5 after Mono installation.
Apparently I cannot compile my app as I get the errors like:
Error CS0234: The type or namespace name `Sockets' does not exist in the namespace `System.Net'. Are you missing an assembly reference? (CS0234) (Communicator.Presentation)
I completely cannot get what is going on here. I've searched through net and forums and cannot find the answer for that issue.
I am also providing the screenshot from my PC with MonoDevelop opened where you can see that System.Net reference is added to the project, but the inside classes are not visible. When I type "System.Net." it only allows me to choose "System.Net.IPEndPointCollection" and nothing else:
EDIT:
What is also weird it that if i double-click on that System.net reference in MonoDevelop in the "Assembly Browser" windows I can see the contents of this "System.net.dll" and especially System.Net.Sockets is present there...:

You don't need System.Net.dll to be included, as you are looking for System.Net.Sockets namespace which exists inside System.dll. So you need to add reference to System.dll. See this link for more details.
So you need following reference:
using System;
I am also attaching my Ubuntu with MonoDevelop snapshots. In these snapshots, you can see that I don't have any reference to System.Net.dll, inside my project references, just System.dll is needed.
Hope this helps.

Related

Why am I getting the following error when compiling this assembly?

I'm attempting to use the following command line command to compile an assembly of the code from my project:
C:/"Program Files"/Unity/Editor/Data/Mono/bin/gmcs
-target:library -out:C:/Users/Austin/Desktop/PixelExpanse.dll
-recurse:C:/Users/Austin/Desktop/Projects/Repos/trunk/PixelExpanse/SpaceColonyRefactor/Assets/Source/*.cs
-d:RUNTIME -r:C:/"Program Files"/Unity/Editor/Data/Managed/UnityEngine.dll
As you can see, I am, I believe, correctly referencing the UnityEngine.dll.
The code that would be compiled contains references to UnityEngine.UI and UnityEngine.EventSystems. But when I run the above command, I get the following compile error:
error CS0234: The type or namespace name 'EventSystems' does not exist in the namespace 'UnityEngine'. Are you missing an assembly reference?
From what I have been able to find through googling, it SEEMS like an error people were getting when using a pre-4.6 assembly, because thats when EventSystems and UI were both introduced. But I don't know how I could be missing that in the dll I'm referencing as Unity 5 is the only version that has ever touched this computer.
As a side note, I have posted this question to Unity Answers and have yet to receive a response. I expect it's because assembly compilation is beyond the scope of what most users there choose to undertake. Hence my asking it here.
The namespace UnityEngine.EventSystems actually appears in UnityEngine.UI.dll and not UnityEngine.dll so it seems you need to reference the former too when compiling manually from the command-line. Unity projects have this by default (see below).
This is verified by opening up the assembly in your reflector tool of choice, here I am using JetBrains dotPeek:
This is how my test project appears with default Unity references. Note that by default a reference to UnityEngine.UI already appears in the Unity-created project:
When I built my Windnows desktop app via Unity, the above dlls appeared in:
<drive>:<projectOutFolder>\<projectName>_Data\Managed
You can try:
right click on "project panel", and after "Reimport All".
It's can be happen due to switch between platforms, e.g. IOS, or Desktop.. thus, folrders are deleted by became unecessary..
Solve for me: Unity 5.2, Win 7, 32bits;
Good luck!
I checked the UnityEngine.dll and the Eventsystems/UI namespace is not included. Despite, there is a dll in Unity5\Editor\Data\UnityExtensions\Unity\GUISystem\UnityEngine.UI.dll which includes these namespaces.
For mac, it's /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll.

error of calling cplex.dll from C# (4.0) .NET VS 2013 on win 7

I am trying to call CPLEX (a mathimatical optimizer) from .NET VS 2013 on win 7.
I have installed optimization.framework.
I have added
using Optimization.Solver.Cplex;
in the code.
I try to run the example at:
http://www-01.ibm.com/support/docview.wss?uid=swg21400073&aid=1
I commented out
//using ILOG.Concert;
//using ILOG.CPLEX;
It can be built. But, I got error:
Unable to load DLL 'cplex100.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I change the DLL to cplex.dll but the same error.
In
using Optimization.Solver
when I typed ctrl+space , I can see that it includes many solvers, including CPLEX.
Why i got this error.
thanks
If you want to use CPLEX, you need to install it. The DLLs that you need are related to the CPLEX version you install, so cplex100.dll is from CPLEX 10.0, cplex124.dll would be from CPLEX 12.4, and so on. It is a commercial licenced product, but academics can get free/cheap copies.
You need to locate cplex100.dll in your installation and add an appropriate path to your project's linker properties – for your convenience: in detail described here.

MonoDevelop project build fails with 'The type or namespace 'GDK' could not be found

'...are you missing a using directive or an assembly reference?'
I tried the solution in this question Gtk# in monodevelop not working anymore after upgrading to ubuntu 11.10 unity but appears to not work here.
I am running on Mtn Lion with lastest MonoFramework 2.10.10 and MonoDevelop 3.1.1
Any suggestions to get build going? Thanks.
The error message says exactly what you need to do.
Add reference to Gtk# assembly if no one.
Add using Gtk; to your code.

WebDeploy API for .NET

I've installed MSDeploy on my machine. I am using Visual Studio 2010 and C#. Trying to load 'Microsoft.Web.*' to code some sexy msdeploy functionality. Perhaps I'm a level 3 tard (highly probable) but the documentation for getting this absolutely blow as#.
The error I get is:
"The type or namespace name 'Web' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)"
So -- of course I try to load it via References, but it aint there. I then Google like a mf for "webdeploy api C#" and the such and cannot for the love of the giant spaghetti monster find anything on how to install / download the msdeploy ("microsoft.web.*) .dlls, apis.
Anyone can point a brother to a link?
I did download and install "WebDeploymentSetup.msi", but nope. I did install "webdeploy_en.msi" but nope. Then I found this craaaazy thing called "AzurePack.exe" -- didn't even try to install that. But, will if someone says that's it.
Thanks.
The Microsoft.Web.Deployment.dll can be found here:
c:\Program Files\IIS\Microsoft Web Deploy V3\Microsoft.Web.Deployment.dll
Point a reference to that.
The only prerequisite is installing WebDeploy v3.0:
http://www.iis.net/downloads/microsoft/web-deploy

nettiers data class library not recognized

I needed to make a console application using nettiers class libraries. I created a new Console Application project, added references to all the libraries from NetTiers and created an app.config file with all the necessary configurations. I get intellisense and no errors and everything when I am doing the coding, but when I go to compile the application, I'm getting an error that PPGEDI.Data doesn't exist.
I only have 1 line in the program.cs Main method:
PPGEDI.Entities.VansEntity van
= DataRepository.VansEntityProvider.GetById(16);
I'm getting the following error:
Error 93
The type or namespace name 'Data'
does not exist in the namespace 'PPGEDI'
(are you missing an assembly reference?)
It's frustrating, because I know I've added the assembly reference:
I'm using Visual Studio 2010, with C# and .NET 4.0. Can anyone give me an idea as to what I need to do to get this to work.
As a note, this works if I use the same statement in a method on an ASPX page in the web application generated by nettiers.
#BrokenGlass, you were absolutely correct. I double checked and it was
set to ".NET Framework Client Profile", I changed it to .NET 4 and
it's working now, can you put that as an answer?
You are using the .NET client profile in your console app which is a "minified" version that doesn’t contain all assemblies.
The problem is that when your app adds a reference to a class library that is targeting the full framework, references to the "full" framework assembly will not resolve. This results in the rather non-forthcoming error message that you see. Switching to the the full .NET 4 as target framework will resolve the issue.
For a more in depth overview of the problem and the .NET 4 Client Profile in general also see "What’s new in .NET Framework 4 Client Profile RTM"

Categories