Solved

Do you need to install C# separately on ASP.NET

Posted on 2015-02-06
12
122 Views
Last Modified: 2015-02-14
This must be too basic a question and I have to assume that you have a choice of using C# or VB.NET in ASP.NET pages because there is nothing online about it.  Also I'm wondering if there is a separate pure ASP.NET language that is not VB.NET
0
Comment
Question by:vrosas_03
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 
LVL 34

Assisted Solution

by:Mike Eghtebas
Mike Eghtebas earned 250 total points
ID: 40595013
When you install Visual Studio, it comes with all sort of language options like vb.net, c#, F#, c++.

And then on top of that, that you have the choice of developing windows applications or asp.net. applications.

Have you installed Visual Studio? If not, there is Express version you can download and work with it from http://www.visualstudio.com/en-US/products/visual-studio-express-vs.

Mike
0
 

Author Comment

by:vrosas_03
ID: 40595021
Ok so your saying that ASP.NET requires visual studio?  You can't use notepad to create ASP.NET files?
0
 
LVL 34

Assisted Solution

by:Mike Eghtebas
Mike Eghtebas earned 250 total points
ID: 40595025
No. You can do using notepad. It will be much harder without all those intellisense and other tools.

There was a company I did a project that they installed the backbone .net famework but had to proceed without visual studio. Not very many people choose that option maybe that is why you are not able to find many references to it.
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40595073
ASP.NET is a server-side framework for creating web applications. It sits atop the .NET Framework. You certainly could write your pages using Notepad, but it would be difficult, as was already mentioned. And theoretically you could write the "code-behind" pages in any .NET language (e.g. C++.NET), but at this time it's really only C# and VB.NET which have integrated support within Visual Studio. You only need code-behind pages for dynamically generated content. If you're just serving up static content, then you would work with IIS directly rather than needing anything that ASP.NET provides.
0
 

Author Comment

by:vrosas_03
ID: 40595080
I don't want to actually use notepad.   I was just using notepad an example.   I use vim.  Is there a compile involved?   Or can IIS display C# text files?
0
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 250 total points
ID: 40595083
IIS is a web server (software), so yes, it can display text files. You can host media files, XML files, HTML files, etc.

There's only a compile involved if you make either an ASP.NET web site project (and precompile it), or if you make an ASP.NET web application project. If you just host static files, like HTML, then you don't have anything to compile.
0
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 250 total points
ID: 40595089
P.S.

Even if you did need to compile, the C# and VB.NET compilers are invoked from the command line. You could easily write a batch file or even an MSBuild file to automate your compilation. But again, you only need this if you're using ASP.NET for dynamic content. I've never really compiled anything by command line directly, but I have seen it demonstrated in the docs. I'm not certain how web site projects compile, but I'm sure it's documented somewhere.
0
 

Author Comment

by:vrosas_03
ID: 40595091
It seems like it can handle plain text files.  I only need to run a few lines of asp.net code:

It works with this code:

			<p><% Response.Write(Now())%></p>

Open in new window

   But I got an error on the following code:
			<%
	string[] myArr = newstring[] { "a","b","c","d","e"};

foreach (string strArr in myArr)
{
     Response.Write(strArr + " ");
}

				%>

Open in new window


The second section of code doesn't work but the first does.  I get this error:
C:\inetpub\wwwroot\iisstart.aspx(40) : error BC30109: 'String' is a class type and cannot be used as an expression.

    string[] myArr = newstring[] { "a","b","c","d","e"};

Open in new window

0
 
LVL 34

Assisted Solution

by:Mike Eghtebas
Mike Eghtebas earned 250 total points
ID: 40595100
a space missing after new keyword:

string[] myArr = new string[] { "a","b","c","d","e"};
0
 

Author Comment

by:vrosas_03
ID: 40595107
I noticed that and changed it and it still doesn't work.  

 BC30109: 'String' is a class type and cannot be used as an expression.
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
ID: 40596942
That code should work fine. Are you sure those are the offending lines?
0
 

Author Closing Comment

by:vrosas_03
ID: 40610376
I was able to run the text files with c# in them if  they are surrounded by the <%   %>  tag delimiters.  I don't know if it pre-compiles it beforehand  but there is a compiler in the IIS folders  and I can compile c# code using the compiler in those folders.      Apparently it works the same as php with a few minor changes.
0

Featured Post

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question