I am getting the following error while trying to run Robocode.bat
error: could not find or load main class robocode.robocode
I checked the java Installation, I checked it in the java website, the installation is fine.
I also added the path in environmental variable.
My OS is Windows 8
Also I am trying to install RoboCode for.Net
The problem is, that the bat cannot find the robocode.jar
check if it is still in the lib folder of your installation. and you did not move the bat file
Make sure to follow this instruction (i.e. install the java version of Robocode, then install the Robocode .NET plugin):
.NET plug-in for Robocode must be installed on top of your existing
Robocode directory.
http://robowiki.net/wiki/Robocode/.NET/Create_a_.NET_robot_with_Visual_Studio#Prerequisites
[Old question I know, but I ran into this problem today and didn't see this answer here.]
Related
I've been trying to set up .NET on my Windows 10 computer. I downloaded the latest SDK and I ran the installer, and it was succesful. However, whenever I run dotnet --version in command prompt or powershell, it says it can't find any version of it. However, when I ran the command after launching it from file explorer(typing cmd at the top where the file path is), it gave me the correct version(latest). I tried adding it to the path as well, still nothing. I also tried uninstall reinstall and a repaire, nothing works. I'm trying to learn the C family and I'm starting with C#, however I can't execute my codes through visual studio code or command prompt. What should I do?
https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/intro
Quickstart for .Net - core app.
To answer my own question, I somehow had a corrupt entry, and instead of trying to just repair it with the installer, I had to uninstall(yes I'm stupid I forgot to do this before), and reinstalled it. It now works perfectly.
So I did this again on my laptop, had a different problem though. It seems that I had multiple installations of dotnet, one a 32 bit and one 64 bit.
Ran this to check if there were multiple installed:
where dotnet
I then deleted both of them, and reinstalled and presto!
I am getting an issue with installing the .NET SDK, at first when I went into visual studio 2019 it said that I was missing the dotnet runtime sdk so I installed it like it asked and restarted my computer. I then went on to visual studio 2019 again, and the same issue arose, I went into my command prompt and typed dotnet --list-sdks and it displayed no sdks. I have all of the runtimes installed, but it says No SDKs were found. image . I tried re-installing the sdks but the same problem stuck. I even went as far as to re-install IIS. I can't do anything without this being fixed please help soon!
Before you try a manual install, I'd check if the Path in the system's environment variables is correctly configured for your system.
Given that there's always one shared host that moves forward, it will either pick the x86 or the x64 version on your machine. This issue of not picking the right one might happen if you install multiple/different versions.
Run the where.exe dotnet command to see where the host is looking for the SDK (it's the first entry returned). If you're on a x64 machine, you want to have C:\Program Files\dotnet listed first.
If it's not, edit the Path system's environment variable to have the location you want showing up higher. Doing that should fix the issue of the SDK versions you installed not showing up when you run dotnet --info.
See The latest installed .NET SDK not found for complete instructions.
Answer above by Maira is correct and fixed the issue however for those that need a little help go to start menu, type "path" and select "Edit the System Environment variables". When that opens, under the "Advanced" tab click "Environment Variables".
Under System Variables find the "Path" variable and click "Edit". Find "C:\Program Files\dotnet" and click "Move Up" so that it is above the (x86) variable.
I managed to find the answer to this problem, and anyone else who is having this problem can most likely fix it with this solution too! So the reason it breaks is because of the way the .NET Core SDK installer works, it does not install the SDK correctly for some reason, so you have to do it manually. Go to this link, where you would normally get the installer for the SDK but rather than downloading the normal version, download the binaries version. It should download as a .zip, so extract it and then copy the contents of the folder. Go to C:\Program Files (x86)\dotnet\ and then remove it's contents, finally paste your clipboard into the folder. Now try it out, open a new command prompt or PowerShell, and type dotnet --info. It should tell you that you have all the SDK's and Runtimes installed. Keep in mind, you will have to download the newest version of the binaries, that way you have the latest version of the SDK's.
The reason this works is that you are manually pasting the SDK's into the folder, if anyone could start a ticket for the installer to Microsoft, {EDIT: MS created an internal ticket and this answer is wrong. See next answer End Edit} that would be great, and link them to this post so that they can understand what's going on. Some of you might have come here because you are fed up with reading Microsoft documentation and to be honest, so was I! Now this might not fix all the problems you are having, for example, I am still having problems with visual studio and their .NET implementation but if I or anyone figures it out, I will add it to this answer. Hope you have a great day, bye!
dotnet do not seem to match well with SDKs / runtimes with 32-bits and 64-bits. If you have both variants and want to only use the 64-bits (or generally, cant list up any SDK-s), you can try this :
Inside folder : C:\Program Files (x86)
Rename folder 'dotnet' to 'dotnet_x68'
Inside a shell (remember to either run command 'refreshenv' from Chocolatey for example to refresh your environment, if you have choco installed.. )
Enter now this command :
dotnet --info
Also list the SDKS :
dotnet --list-sdks
This fixed up my development environment. Note that if you want to use dotnet against x86 system, you might consider to instead uninstall x64 variants of dotnet runtime and sdks as dotnet do not seem to work very good from command line with a mix of them both (and avoid renaming the x86 folder of dotnet of course as suggested above.
I found that I had two program files, One called Program Files (x86) and one called Program Files. I went to Settings, About and looked at my System Type. I have a 64-Bit operating system and so I went into Program Files (x86) and found another dotnet folder. I deleted the dotnet folder and restarted Visual Studio. It Worked after that.
If you get this issue like I did on a ARM based Mac M1 or M2 then do the following.
remove this directory completely /usr/local/share/dotnet
run the installer package again
I believe this issue happened when I accidentally installed dotnet-ef x64 instead of arm64.
I've been trying to run a C# project in Visual Studio and keep getting hit with the error:
'"dotnet.exe"' is not recognized as an internal or external command,
operable program or batch file.
From what I've seen online, several people have managed to fix this by messing around with the SDK or with the 'path' environment variables in Window's System properties tab. The problem is, I have no idea what any of these system settings and specifications do, and I can't get a clear answer.
I can tell that VS isn't able to get dotnet working, so what ideas come to mind to fix this error?
Install the DotNet Core Runtime or SDK (I use latest version)
The SDK has all the tools needed for development (including the runtime), while the Runtime is needed for running dotnet core applications.
After installation, you will need to restart the PC yourself so that the data entered in the PATH variable are available
Runtime link
Check if you have %ProgramFiles%\dotnet\ folder in your PC, that's where the dotnet.exe file should be.
If you found none, that mean you have not installed .NET Core SDK/Runtime. As you have VS, I am assuming you are writing some code with it, you should install the SDK from here.
If you have the folder but still have the problem, go to your Environment Variable, add that folder to the end of PATH variable and restart the PC.
So I built a service in C# and I am trying to use the following command to install it:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\installutil.exe MyService.exe >> installLog.txt
It fails. When I look at the installLog.txt, I get this:
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.3053
Copyright (c) Microsoft Corporation. All rights reserved.
Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\MyService.exe' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded..
The same approach works fine for installing a different assembly. I feel like it might be because the one that fails was written for .NET 4.0, and the one that works is in 3.5.
Does anyone have any experience with this problem?
You are using the wrong installutil.exe If your application is built against .Net 4.0. Use the the installutil.exe in the 4.0 folder.
For x86:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe
For x64:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\installutil.exe
Nobody even came close to getting this one!
Here's what I had to do:
Right-click the service project in Visual Studio, go to "Properties"
Set "Startup object" to the name of the service (it had been set to the value "(Not Set)").
Save.
Build
Try to install again.
It works! Yay! We can all go home!
Link to the code project article that helped:
For those of you who don't find that this fixes their problem you need to look in the Launch conditions of the .vdproj file and change the .NET framework to 4: http://www.alexjamesbrown.com/uncategorized/deploying-net-4-project-error-1001-system-badimageformatexception/
For me I just right right clicked on the exe I was trying to install and clicked "Unblock"
If you compile on x64 machine, be sure to go into Configuration Mgr and change the build to x64. Of course you'd want to check to make sure you're using the right version of InstallUtil.exe. g'luck.
Having same issue, nothing from above was helping on windows server 2019
tried to run compatibility test, after that the registration suddenly worked:
I believe you provide the answer in your question:
"This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.."
So you might have compiled the runtime with newer functions (which are in newer Frameworks) but the computer you are registrating it on is running a lower version.
Eg. compile for .NET 3.5 but install the service afterwards on a .NET 2.0 wouldnt make sense.
Since you are able to install services on the destination machine, I guess you already are admin. So just upgrade the .NET framework on that service-machine.
Have you tried simply typing MyService.exe /install in a Command Prompt window in the directory containing your Windows service? That has worked for me in the past. You can also uninstall a Windows service by using MyService.exe /uninstall.
I had the same problem. Initially my project was in a very long path on D:\ inside the debug folder of my project.
The problem was solved when I moved the .exe service file to another location with a shorter path and started with "C:\".
I also use this batch file to install the my services
#ECHO OFF
REM Directory for .NET 4. Check for other version directories.
set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319
set PATH=%PATH%;%DOTNETFX2%
echo Installing MyService...
echo ---------------------------------------------------
InstallUtil /i C:\ServiceFolder\MyService.exe
echo ---------------------------------------------------
echo Done.
pause
If you tried all the above and still see the same error, double check if you have a 32-bit application or any 32-bit DLLs and your server is a 64-bit server.
Wasted an hour on this,all I had to do was add quotes for the service path.
Step 1) cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
add the directory of the .exe path in quotes as shown
step 2) InstallUtil.exe "E:\MyNewService\MyNewService\bin\Debug\MyNewService.exe"
ref: https://www.codeproject.com/Answers/5143174/Installing-windows-service-error-installutil-exe-i#answer5
I downloaded setup.exe, and then begin to install and it immediately crashes.
On win7 it worked fine. On XP it doesn't work.
Error text:
Unable to install or run the
application. The application requires
that assemble stdole Version
7.0.3300.0 be installed in the Global Assembly Cache (GAC) first.
You'll need to include stdole.dll as a required file in your Publish settings in Visual Studio. Once you publish your app again, it should then include that file in your app when it's installed.
More info can be found here.
This happened to a few people that i had to install a click once application i developed. Basically something happened in their installation of .NET and the needed .DLL's were not moved to the GAC. It's very simple to fix, basically You need to copy stdole.dll from C:\Program Files\Microsoft.NET\Primary Interop Assemblies\ to C:\Windows\Assembly ... that should fix your issue. Including them in the application isn't the best idea, this will fix it for ALL click once applications rather then just that one you are currently building.
P.S. Dragging the files to the location will work, you might get an error if you try to copy it.