Forums

.NET 4.0, the easy way

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

.NET 4.0, the easy way

Postby Charles » Sun May 29, 2011 12:48 am

EDIT: The installer now prompts for whether or not you want a .NET 4.0 installation.

I have added a -net4 option to the installer that works on both .NET+Windows and Mono+Unix-family:

Code: Select all
cd CobraWorkspace
svn up
cd Source

# Windows:
> bin\install-from-workspace -net4

# Unix-family:
$ sudo ./bin/install-from-workspace -net4

On my own Windows 7 32-bit test box, the .NET 4 C# compiler was present, but apparently not all the necessary .NET 4 components were available to compile with. I found this very strange. If you get compilation errors, make sure that you have previously installed .NET 4 or the .NET 4 SDK or a Visual Studio 2010 product (the Express editions are free). After simply installing .NET 4 and nothing else, installation of Cobra was successful for me.

If you can think of a way that the installer can gracefully handle this situation, patches are welcome.

I also enhanced "cobra -about" and "cobra -version" to include the version of the run-time VM and to indicate if it was running on .NET or Mono like so:
Code: Select all
cd ..

$ cobra -about
The Cobra Programming Language 0.8.0 post-release on Mono CLR v4.0.30319

> cobra -about
The Cobra Programming Language 0.8.0 post-release on .NET CLR v4.0.30319

You'll want to cd out of the CobraWorkspace\Source directory first to examine the installed version. If you don't install with -net4, you'll see a 2.0.x version number even when using ".NET 3.5" DLLs for example. This is because the virtual machine / run-time in .NET 3.0 and .NET 3.5 was not updated. It's a normal thing.

I also improved the installer to output some tips and urls if it errors out. And to print the Cobra url (http://cobra-language.com/) on success to encourage people back to the site.

You can review the refinements via the Trac timeline if you're interested in more details.

After these changes, I welcome testing and feedback. See How to Install from Source if you don't already have a Cobra workspace to build from.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: .NET 4.0

Postby RIGHT_THEN » Sun May 29, 2011 2:25 am

hello Charles

Charles wrote:On my own Windows 7 32-bit test box, the .NET 4 C# compiler was present,
but apparently not all the necessary .NET 4 components were available to compile with.
I found this very strange. If you get compilation errors,
make sure that you have previously installed .NET 4
or the .NET 4 SDK or a Visual Studio 2010 product (the Express editions are free).
After simply installing .NET 4 and nothing else, installation of Cobra was successful for me.


this quote is confusing me. C sharp 4.0 compiler was present on your machine
but wont compile cobra. then you went on to install .Net 4.0 and then it worked.
where as you are suggesting installing SDk,Vs also to the user for it to somehow work.
how did it work for you?
with the additional components i.e sdk,Vs installed or merely .net 4.0 installed and others removed.

Anyway it worked for me because i have all the things Vs,SDk installed allready on my Win7-32bit Os
so error is not reproducable on my machine.

but i can think of a senario which you might have overlooked
or might have went missing in your thoughts.
.net 4.0 now comes with profiles(Client/Full) that is you can either install
Client profile(which is less in size) or Full .net 4.0(which is more in size) on your machine.
if your previous installation was Client profile than obviously it might not have all the
nessecary components to compile Cobra. but nevertheless Client Profile install has just the nessecary assemblies to make
most of apps run but developers should use Full profile.

Thanking_You
RIGHT_THEN
RIGHT_THEN
 
Posts: 99

Re: .NET 4.0

Postby Charles » Sun May 29, 2011 2:31 am

I was able to find a C# 4.0 compiler on my system. However, when I tried to install Cobra, there were errors about missing libraries.

To fix the problem, all I had to do was to install .NET 4.

There are three ways that I know of to make your Windows machine viable for installing Cobra:
1. Install .NET 4
2. Install .NET 4 SDK
3. Install Visual Whatever 2010

If you have done any of those three in the past, then you shouldn't have to do anything at all anymore.

Regarding your comments, it appears that if we can detect what profile the user does or does not have installed, we could give a nicer error message.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: .NET 4.0

Postby RIGHT_THEN » Sun May 29, 2011 7:13 am

RIGHT_THEN
 
Posts: 99

Re: .NET 4.0, the easy way

Postby Charles » Wed Jul 13, 2011 8:49 pm

I have now added a prompt to the installer so you don't have to remember to pass -net4 on the command line:

Code: Select all
==== .NET 4.0 Prompt

Cobra can be installed for .NET 2.0/3.0/3.5 or .NET 4.0.
Do you want to install for .NET 4.0? [no] _
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 44 guests