I'm going to start writing c# coding with eclipse. I installed c# extension from eclipse marketplace. I made the dotnet.exe path with window>preferences>.NET Core with C:\Program Files\dotnet\dotnet.exe, but when I create a new project, ".net not available templates, see preferences." I get an error. how can i solve it?If there is something missing or wrong, let me know.
dotnet versions:7.0.102
I've looked in many places on the internet but couldn't find a solution.
Related
I am currently using Manjaro Linux 20.2, with official JetBrains Rider from JetBrains Toolbox
I have installed this package package screenshot
When I'm writing in my terminal "mono" it runs.
File location also looks fine.
When I'm opening my Environment tab in Rider. I got this.
Environment Tab
I can create and run/execute/debug any projects with my .NET CORE
But I can't use the framework at all.
A simple application like this New Project Window
And here... the error
In my settings -> build and execution -> I have these parameters
path settings
I don't know what to do and how to fix this error. Tried many times disinstall/reinstall the Mono Package. But it's always the same.
Maybe I should change somehow a Mono path here in Rider Settings ?
But I don't know to where.. there are so many of these files in usr/lib and usr/bin
Please help me, I don't know what to do next and how to fix this..
I just know for sure. That it is possible to run Mono on UNIX.
Something is wrong..
UPD1: I've discovered, that to run Mono on Linux. I should install a different package "monodevelop"
But according to GitHub, this package is not build-able on Linux anymore (only on MacOS)
I've discovered this "dotdevelop" package..
https://github.com/dotdevelop/dotdevelop
But I don't know, it's looks like it doesn't work for me either.
Or maybe I'm just putting a wrong file to my mono path settings in Rider..
UPD2: Maybe there is still hope for me, if I'll use .NET FRAMEWORK from inside a container ?
https://hub.docker.com/_/microsoft-dotnet-framework
I know how to use Docker. It will be possible to use it in my Rider ? I don't get it.
This answer essentially has what you're looking for. There is an issue in recent mono packages for some distributions that causes Rider not to have a proper reference to the mono libraries.
JetBrains Rider not detecting mono or Unity API
I've tried this on Debian 11 and it works as expected. I also use an Ubuntu machine and I didn't have to do this. I'm not entirely sure why, all I know is that some distros need the override set in in order to work. I use KDE Plasma and used their method of setting environment variables. There's a million ways to do that, check Majaro's documentation for what's best for your system.
**Before reading below, be aware that we're talking about legacy software and there's no guaranty that Mono will work in the future since it has been superseded by .NET (core). New development should be done there rather than Mono/.NET Framework unless you really need to. Just be aware it's legacy at this point and ymmv.
As for the other comment that there is no .NET Framework on Linux, that's not completely true. Mono is the .NET Framework implementation for Linux and macOS. It supports a large portion of the .NET Framework that exists in the Windows version, however it has some drawbacks.
For instance, WinForms is only partially supported and extremely buggy. WPF will not work at all.
ASP.NET can be run under Apache with a plugin, however it doesn't support all of the frameworks that you can use on Windows. For modern .NET web development on non Windows platforms, .NET 5+ should be used.
Another weird one is that the Console.Beep() method works unreliably. The Console.Beep(int frequency, int duration) method also doesn't work on macOS at all.
Other than those examples, there's other things that won't work which are mainly things that rely directly on the Windows API though it's possible to run .NET in some capacity under WINE. This isn't recommended though. Anything that uses COM will not work as well. It's also practically impossible to use a printer so that's probably out.
You can review https://www.mono-project.com/docs/about-mono/compatibility/ for a better list of what is and isn't supported.
For console applications, mono works quite well. Just be aware that not everything will work.
Good luck!
You should create a console application by choosing "Console Application" under ".NET Core".
I wonder why Rider guys decided to show the projects under ".NET" to mess things up. Beginners like you won't be easy to know what they are and how to run them on non-Windows machines.
I have a c# solution that accesses a c++ project through COM. The project has to be targeted to a specific processor, in this case x64. I am using the Windows installer to install the application.
The first problem I ran into was the c++ dll was not being registered properly when installed, and the program couldn't access it. I solved this by adding the c++ project to the solution.
For a while this worked, and everything installed properly, but then I started getting the following warning when I tried to build:
The target version of the .NET Framework in the project does not match the .NET Framework launch condition version '.NET Framework 3.5'. Update the version of the .NET Framework launch condition to match the target version of the.NET Framework in the Advanced Compile Options Dialog Box (VB) or the Application Page (C#, F#).
The setup would not install if I tried ignoring the warning. After some searching, I found that the c++ project was building in .NET 4.0, while my solution used .NET 3.5. I tried changing my solution to 4.0, but for some reason it stopped working, so I changed the c++ to 3.5.
This worked for a couple of builds, but then I began getting the following errors:
Error: LNK1104 cannot open file 'mfc90.dll'.
I added the file to the Additional Dependencies section, but then another link error occured (mfcs90.dll) and when adding that one, I got an x86 x64 conflict.
I'm not sure why these solutions worked for a while and then stopped, and I can't seem to find a resolution at any step that works. If anyone has seen anything similar to this, the insight would be appreciated.
In order to include the Microsoft runtime dlls, you should not simply include the dll in your application directory. This won't help when the dlls have various dependencies and you might run into different conflicts and versioning issues.
The way I would recommend installing the runtime dlls for you application is to include the official merge module in your MSI.
See the following link for your options to redistribute the runtime library:
http://msdn.microsoft.com/en-us/library/ms235316(v=vs.90).aspx
Mono's C# REPL has on its page this bit of info:
A GUI version of this tool is called gsharp and is available when you install the mono-tools package
The same bit of info is mentioned in the Mono 2.2 release notes.
However, while I've installed the 30-day trial of mono-tools (vsix for VS2010), and the normal Mono for Windows package (2.10.8), I don't see anything in either that lets me open the window from the screen shot "C# InteractiveBase Shell". I also can't find any files on my disk (after installing both) starting with 'gsharp'
Did 'gsharp' move somewhere else?
I know the source is available as part of the mono-tools repo # https://github.com/mono/mono-tools/tree/master/gsharp, but just trying to find a 'release build' to use instead if possible. :)
Mono-tools for Visual Studio is a former product of Novell, which is discontinued (which Xamarin doesn't offer either).
I recommend you try to install Mono for Windows official bundle from http://www.mono-project.com/ If that installer doesn't include it, I recommend you compile mono-tools yourself, shouldn't be very hard with cygwin or mingw32.
PS: Note, "Mono tools for Visual Studio" and the "mono-tools" module (https://github.com/mono/mono-tools) are two different things.
(BTW, Mono 2.2 is very old. Only accept Mono 2.10.x or higher nowadays)
I have been recently trying to deploy a C# application on a computer that does not have .NET installed.
I know that there have been many questions around the same topic here on StackOverflow. Here are a few of them, of which I read the responses to all:
Packaging up the .net framework with a .net application deployment
Run a .net application without installing .net client profile?
Run C# windows application in windows XP without installing .NET Framework
So all of the responses to the above questions state that it is impossible without specific software, etc. One software mentioned was the Salamander .NET Linker. The only problem with that is that I cannot seem to be able to run the application after it has been processed by Salamender. I understand that this in itself is impossible, as it requires the .NET virtual machine to run. However, in the past, I have made Java applications and along with them, I shipped the entire JVM. Surprisingly, they still worked. So the reason why this is not a duplicate of the above questions is because my true question is:
What items of the .NET framework would I need to package? If I do manage to package all, would placing them in the same directory as the application I'm running allow the application to run?
I found one solution to this, the Microsoft .NET Redist Package. The only problem with this is that it has a GUI of its own. Aside from that, it would be a perfect fit. So, could anyone tell me one of two things:
Is there a command-line .NET package, and if so, where do I download it?
If there isn't, or it would be impractical to do so, approximately what directories would I need to copy from the .NET installations?
I understand that these files and directories are system specific, and that my .NET installation may not work on your computer, but if C# is like Java, then this should be achievable. Is it? Size is not a limitation, it does not matter to me whether or not the application and all its files is 1GB, or if it is only 1MB.
If in case there is no other solution, I used Dependency Walker to check all the dependencies of my program. If I were to package most of them, would my application, in theory, work?
For .NET, you really must just install the appropriate .NET framework. The .NET framework installation does include command line options to allow for silent installs, such as:
dotnetfx35.exe /q /norestart
For details on the command line options, see the options for 3.5 and for .NET 4.0.
That being said, most installation packages will handle these details for you as part of the installation. Using a decent installer will take care of this dependency automatically.
Depending on the pieces of the .NET Framework you need, you can use Mono. It supports shipping the runtime without installing just like you would a JVM, or you can statically link against the binaries to create a native executable .
If you are planning to deploy your application (and presuming the setup process doesn't need to be too complex), you can simply create a Setup project in Visual Studio and then bootstrap the prerequisites (.NET framework, and other stuff you think you might need).
You can follow the steps described in these MSDN articles:
How to create a Setup project in Visual Studio
How to add prerequisites to a Setup project
A walkthrough is given in this CodeProject article.
For more complex deployment scenarios (such as installing device drivers along your app, or better localization support), I would recommend looking into WiX (Windows Installer XML) toolset. It's a toolset that builds Windows installation packages, which you configure using XML files inside Visual Studio. WiX also supports various bootstrapping scenarios.
This page covers the differences between VS Setup projects, WiX, and InstallShield.
I'm trying to get Antlr working using NuGet.
The current version of the Antlr.Runtime.dll that I'm trying to reference is 3.1.3.42154.
The issue is that when I try and build my Lexer and Parser .cs files I get a lot of build errors about missing types.
e.g. The class GrammarRuleAttribute cannot be found. I've looking in the Antlr.Runtime.dll and the class isn't there. However if you look at the Antlr project on GitHub then your can see the GrammarRuleAttribute should indeed be in the Antlr.Runtime.dll.
Is this a bug or am I missing something?
This is a somewhat time-sensitive Q/A because the C# targets for ANTLR (CSharp2 by Johannes Luber and CSharp3 by myself) change over time. I know the CSharp2 target has had some issues recently that are being worked on. As of this writing, the current version of the CSharp3 target is 3.3.1.
Here is a link to the CSharp3 target documentation, which includes several download links to the C# port of the ANTLR tool, the CSharp3 runtime, MSBuild support, and some tools for Visual Studio. I update this document periodically as new versions are released.
Edit: If you are experiencing display problems or exception messages when opening a grammar file, you should uninstall the ANTLR 3, StringTemplate, and Extensibility Framework extensions from the Extension Manager and reinstall them per the instructions in the linked documentation. I've updated the extensions to resolve the problem.
I had this problem when using CSharp2 or CSharp3. I'm building in ANTLRWorks 1.5rc1.
It turned out to be related to the ANTLR version. I installed the official package using NuGet, which was 3.1.x. After removing that and installing the unoffical 3.4.1 package, it worked.
There was still a minor issue relating to the HIDDEN channel in my test grammar. Changing it to Hidden (as defined in Antlr3.Runtime) resolved the issue