Attempting to run C# on cloud9 IDE but receiving errors - c#

I’m new to Cloud9 and I’m facing some issues.
I’m attempting to run the C# code on the IDE and am failing to do so, I think I know why but I cant seem to be able to resolve the issue.
The picture uploaded below should have everything needed to solve the problem
enter image description here
Upon further research, I found a link that goes through a step by step process on how to install .NET core. However, I'm having issues, with setting the project template using this code for the terminal dotnet new console -lang C#
It starts decompressing then stops at 99%. (as indicated in image below) The first error that pops up states that System.IO.IOException: No space left on device not sure what to do with this though.
https://imgur.com/a/30Vh6Eu
I kept on attempting the same code and it has managed to complete the decompressing stage only to start resetting again at the Expanding stage. (Refer to image below).
https://imgur.com/a/UMtpYow

Run C# is not yet supported on Cloud9 IDE
https://docs.c9.io/docs/supported-languages

I think #shingo is correct to say C# is not supported BY DEFAULT. It is possible, however, to make it happen as shown in the links below, but not advisable as there is little help out there. I wouldn't do it if I were you.
blog help
youtube
aws documentation not specifically about c# but related

Related

How to use a Python virtualenv in a .NET-project for processes?

I am working on a webapplication in .net using razor pages in the mvvm-model. I've written a crawler/parser in Python that I need to control from my .NET-project. So I found another stackoverflow post that helps me solve this issue.
In order to keep my Python environment clean and organized, I've used a virtualenv to keep my libraries (BeautifulSoup4 and Requests) separated from my global interpreter. This all worked out the way I wanted.
However, I have reached a point where I need to connect both applications. So I put me parser in a separated folder within my .NET project. Furthermore, whenever my form is validated etc and reaches my OnPostAsync-method, it starts a process just like the above mentioned post describes.
But when I hit the submit button I can see in my console it is unable to find the correct packages in my Python application, since I am getting the famous: ImportError: No module named 'bs4'. I am aware this error is known and widely answered before, but I have a different question.
Question
I'd like to know how I fix this error with respect to my .NET-project and the virualenv. So i.e., is there a way to use or to link my virtualenv from Python in my .NET-project?
My Python-project-structure is:
/app/
/src/ <-- Source code
/output/ <-- Not relevant
/tests/ <-- Not relevant
/venv/ <-- Installed libraries
main.py <-- Entrypoint application
If I understood your question well, you can specify which Python interpreter the script will be run with by modifying its first line, in the same way Bash does:
#!/path/to/venv/bin/python
There should be a file /venv/Scripts/activate_this.py which contains code to activate the venv in the current interpreter. The docstring of the file says
Activate virtualenv for current interpreter:
Use exec(open(this_file).read(), {'__file__': this_file}).
This can be used when you must use an existing Python interpreter, not the virtualenv bin/python.
My source is in the parent directory of /venv/ so I use the following to activate my virtualenv.
import os
venv_activation_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), 'venv', 'Scripts', 'activate_this.py')
exec(open(venv_activation_path).read(), {'__file__': venv_activation_path})

NancyFX/Linux/Mono - Large uploads (over 1MB) work on windows server but not linux

I seem to have a rather strange problem which I was wondering if anyone could shed a light on.
I am writing an Android app which uploads/downloads files from a self hosted C# server. The server is written in C# (using NancyFX self-host) and the Android app is using HttpClient (Apache) to talk to the server.
When I attempt to upload the files on windows (which is where I manually debug into the server code), the upload works fine for any number of files with any arbitrary length. Everything works as expected and both small and large files get uploaded.
However, when I deploy this server to my Linux box (OpenSuSe) and run it, the uploads behave differently. The smaller files (< 1MB) still work as expected but when the file goes over this limit, the HttpClient's .execute() hangs indefinitely. I tried to set the socket timeout to 10 seconds (to test) and I once received a socket timeout exception but other times, it simply hung there, never even timing out. It's also worth mentioning that the request never reaches the server which would implicate that the problem is most probably not with the Nancy server (although I could be wrong).
Given the nature of the problem, I'm inclined to believe that the problem lies somewhere in the Linux server configuration which does not allow larger POST requests for whatever reason but I've not been able to figure out why that would be the case. I do have a PHP server on that very same Linux box and on that, I can upload files larger than 1MB without any problems.
Other steps I've tried: I've disabled the firewall on the Linux server to see if it was a firewall problem (highly unlikely since <1MB reaches the server just fine) but that didn't help. I also changed the MTU to be in-line with my windows machine but that did not make a difference either.
As it stands, I'm out of ideas. Does anyone know how to trace this further to get to the bottom of the problem? Any help would be greatly appreciated.
Many thanks in advance.
I've fixed the problem with the hanging after spending a lot of time googling it. The problem was with Mono and has been fixed in the latest version (3.4). I've installed this version on my Linux box and the hanging issue is gone.
More details here:
https://github.com/mono/mono/commit/a31b580fdcbaa9a8a16d59ffb12d04f5872f54e8
I have another problem now though. The image file that is retrieved on the server side is corrupt. Given the fact that the very same code works in Windows, I'm inclined to believe the issue rests with Mono or more likely, with NancyFx's code on Mono. I will debug further into it and update the progress of this question, in case anyone else ever runs into the same issue.
So for anyone who runs into this problem, the second problem (with files becoming corrupted) can be solved by editing RequestStream.cs within the Nancy library according to this post (look # response by Rohansi commented on Apr 30)
https://github.com/NancyFx/Nancy/issues/1333
This seems to be a problem with Mono on Linux (I'm using 3.4) where if you specify the async flag in the FileStream, the process does not quite work.
For now, I have built a custom version of Nancy and that's what I'm using. I'll try to ask them to see if it would be possible to disable the async using some configuration in the main library and will also raise the issue to Mono dev but for now, if you run into this problem, I hope the above comments helps you.

C# Vlc.DotNet Libraries - Null reference exception

Recently stumbled upon this post whilst trying to decide on the best way of getting a VLC player into C#.
Does VLC media player have a C# interface?
I downloaded the dll files and imported them into my project, but then realised I had no real idea of how to use them. Has anyone got a Windows Forms example of this code that works? The code have tried is shown below -
Vlc.DotNet.Core.Medias.MediaBase media = new
Vlc.DotNet.Core.Medias.PathMedia(#"C:\Users\...\SampleVideos\Wildlife.wmv");
Vlc.DotNet.Forms.VlcControl vlcControl1 = new Vlc.DotNet.Forms.VlcControl();
vlcControl1.Play(media);
I am also using the code in this link in the main program.cs of my project.
http://vlcdotnet.codeplex.com/wikipage?title=Forms
The current problem I experience is that upon starting the project it throws a NullReferenceException when it gets to ->
vlcControl1.Play(media)
The problem seems to be with the vlcControl but I am unsure why. The documentation seems to rather thin and I couldn't find any working examples on the codeplex site. If anyone has a working forms example or knows what I might have missed please let me know!
Here is the call stack present when the error occurs ->
RTSPViewer_Test.exe!RTSPViewer_Test.Form1.Form1_Load(object sender,
System.EventArgs e) Line 31 + 0xd bytes C#
RTSPViewer_Test.exe!RTSPViewer_Test.Program.Main() Line 30 + 0x1d bytes C#
When debugging it appears that the Media and Medias attribute of the VLC control are both null. When trying to set the Media of the control to the media object created above a
NullReferenceException
Checking the VLC control object Media does indeed equal null, but I am not sure why it hasn't been initialised properly.
I was unable to get the program to work using the latest version of the Vlc.dotnet libraries but instead used the alpha 2 version which was posted by Raj. I used VLC version 1.1.5 with this library to get the basic example to function properly. My end objective was to stream from an rtsp device, however this library does not appear to support this functionality yet.
For anyone looking to use a good C# wrapper for using VLC then this is a great example -
http://www.codeproject.com/Articles/109639/nVLC
Used the library files from VLC 1.1.1 with this project and works fine. Supports pretty much all the features that you would usually use in VLC but gives you much more control over what you use them for.
Many of the issues that arise when using these DLL wrappers arose from incorrect versions of the source DLL files. The VLC libraries are only 32 bit at this time, so you need to make sure to compile using x86 mode otherwise the libvlc.dll will not load properly and the application will crash. Using the above example you must also make sure that the libvlc.dll, libvlccore.dll and the plugins folder are included in the build folder.

Error 1001 An error occured in sending the command to the application

COM Excel AddIn, C#, VS2008
The error happens occasionally when I install/uninstall my AddIn.
sometimes I see Error 1001 the specified file can not be found
Anyone know what causes these and how to fix? thanks
I use windows installer
http://msdn.microsoft.com/en-us/library/2w2fhwzz%28v=VS.90%29.aspx says if use [TARGETDIR], it should be like "[TARGETDIR]\" or "[TARGETDIR] ". I simply use /filepath = "[TARGETDIR]myinstallfile" in CustomActionData
What I do not understand is it works almost all time and fails occasionally
Also even if I change this to including space or backslash, I can't tell if that fixes issue since the issue does not happen every time. Anyone has experience? thanks
I found this and it fixes the issue though I am not sure I ever use DDE in my program
http://sympmarc.com/2010/02/04/microsoft-excel-error-there-was-a-problem-sending-the-command-to-the-program/
Then I found this http://www.opendylan.org/documentation/opendylan/interop2/inte_278.htm
It talks about COM Server
so I went to cmd, type in "Excel.exe /RegServer", then the error disappears.
I am not really not sure if this solution works for all cases.
In fact, I am concerned that I miss sth in installer.
Here is a Microsoft Support page related to an issue which looks quite similar to yours. So for me it looks like a bug in Excel rather than in your installer.
The article is quite large, but it boils down to making sure that:
your Excel app is not running with elevated rights
advanced setting "Ignore other applications that use Dynamic Data Exchange (DDE)" is unchecked
Other than that you might try to repair Excel installation or follow the advice given in this thread of ASP.NET forums to fix the registry for Excel installation.
I hope it helps someone facing similar issues.
If you get this type of error when uninstalling a VS setup project MSI, then the most likely reason is that TARGETDIR is not preserved between the install and the uninstall, therefore it has no value, and attempts to use it in an uninstall custom action will result in failure to find the file. The easiest solution (apart from always installing to known locations such as common files etc) is to save TARGETDIR to the registry and retrieve it later. In the VS IDE you can create a registry item with the value [TARGETDIR] to have it resolved at install time.

Using LAME.DLL from C#, MSCORLIB exception?

Yes, I have Googled this and found absolutely nothing useful.
I want to use LAME.DLL (NOT LAME.EXE) from C# to turn a WAV into an MP3.
The two CodeProject examples (MP3compressor and Aumpel) that every screen scraping help forum points to are broken. In the EncodeChunk() function, it throws an MSCORLIB engine execution exception right where it calls down to the pointer overload of beEncodeChunk(). The error message almost immediately crashes the VS2005 debugger and I get an uncaught exception running it regularly. Running in debug or release mode doesn't change anything, nor does allowing unsafe code.
The Aumpel CodeProject page says source code updates can be found on his site, but this is untrue as pretty much everything but the Paypal link is missing or broken and there's no telling if purchasing his program grants access to said source code or not.
Has anyone seen any working alternatives to using an ugly command line call or porting the LAME source to C#?

Categories

Resources