
Source code of ASP.NET - wfjackson
https://github.com/aspnet
======
ellisike
Scott Guthrie is amazing. He's behind all the open source projects. Some of
them are even taking pull requests. Entity Framework, MVC, ASP.NET, etc are
all popular and open source.

~~~
mrspeaker
Yep - he's the guy that got me into .NET mvc and alt.net... which turned out
to be a gateway drug to Ruby on Rails then Scala. (Genuinely) Thanks Scott!

~~~
weavie
So because of .Net MVC you're now programming on the JVM?

------
d0ugie
For those curious, Microsoft went with the Apache 2 license:
[http://www.asp.net/open-source](http://www.asp.net/open-source)

------
skrebbel
Folks, not much of this is new. Both Entity Framework and ASP.NET MVC were
already open source for quite some time [0][1]. All the other repos are nearly
empty.

The only real news here is that, indeed, ASP.NET vNext is going to be
developed in the open, or at least to some extent. But right now, not a lot of
code seems to be released that wasn't already out there (although I did not go
through all the repos).

I don't think you should expect to find many current/legacy parts of ASP.NET
that aren't open yet: this seems to be mostly for new stuff.

Finally, don't forget that "ASP.NET" doesn't seem to mean a lot (anymore):
it's basically Microsoft actively shipping the org chart. Anything that's web
related and from MS appears to get tacked "ASP.NET" on front of it. Cause
really, what does ASP.NET MVC, basically a pretty uninspired Rails port to C#
(and just an open source library like any other), have to do with "active
server pages"?

[0]
[https://aspnet.codeplex.com/wikipage?title=MVC](https://aspnet.codeplex.com/wikipage?title=MVC)
[1]
[https://entityframework.codeplex.com/](https://entityframework.codeplex.com/)

~~~
chanced
"Uninspired rails port" is a far cry from accurate. I've worked with both
rails and asp.net mvc. I started with rails in the 1.x days but also had
clients that used .net. I despised web forms for a variety of reasons so I
jumped on the mvc bandwagon as soon as the fist community preview was
released.

Hack, Connery, Hanselman, & Guthrie openly acknowledge that rails was a source
of inspiration in their book
[http://www.amazon.com/gp/product/0470384611?ie=UTF8&tag=scob...](http://www.amazon.com/gp/product/0470384611?ie=UTF8&tag=scoblo04-20&linkCode=xm2&camp=1789&creativeASIN=0470384611)
but so was Spring, among others. Above all, I think the .net mvc framework was
trying to capture the fasted-paced, fly-by-the-seat-of-your-pants essence of
the rails way more than anything else. In doing so, they unearthed a lot of
awesome concepts previously unknown to most .net developers like domain-driven
design, tdd/bdd, dependency injection, scaffolding; old hats to Java and ruby
guys.

The mvc .net team did an amazing job of breaking stride with the asp.net
mentality of letting the framework do as much as possible. Yet .net was still
very much confined by it's own structure, forcing the mvc framework to remain
rigid. They opted for configuration over convention which, in my opinion, was
by far the biggest differentiator in rails to the mvc frameworks that preceded
it.

~~~
skrebbel
They also filled it up to the edge with Ruby-like magic all over the place.

ASP.NET MVC is the _only_ place I've ever seen in mainstream compiled
languages where the code can break in untraceable ways if you change the
_name_ of a method parameter (f.ex. for controller actions). Or where models
suddenly don't get data because you forget to add "{get; set;}" to the code
somewhere. Absolutely no way to find out why it went wrong. The data just
isn't there.

Sure, you can learn this and then not make the mistake again, but the reason I
don't use Ruby or Python much anymore is because I've had with with having to
spend a full day going through a framework's source code to find out why my
bug is a bug. In an ecosystem and language like C#, you expect things to
either work or to get a pretty OK error message, preferably at compile time.
The more magic, the more time I waste tracing bugs.

What's the point of using a compiled language if half your code is a dynamic
viewbag of string keys and liberal JSON parsers that just ignore fields it
doesn't expect or can't fill?

It's just Ruby, but then in Visual Studio.

~~~
dragonwriter
> Sure, you can learn this and then not make the mistake again, but the reason
> I don't use Ruby or Python much anymore is because I've had with with having
> to spend a full day going through a framework's source code to find out why
> my bug is a bug. In an ecosystem and language like C#, you expect things to
> either work or to get a pretty OK error message, preferably at compile time.

No, that's what _you_ expect. I expect that the traits of frameworks you
describe to be features of particular frameworks and to be largely independent
of language, except that in languages that don't provide
introspection/metaprogramming facilities that enable them, you probably won't
find them (probably, because usually there may be elaborate ways of hacking
around language limitations to do magic, and then even examining the source
code will make the magic less obvious.)

You can easily have magic-free frameworks in Ruby or Python, and easily heavy-
magic frameworks in most (mostly) statically-typed compiled languages like C#
and friends as long as they have some introspection/metaprogramming facilities
(and optional dynamic typing like C# makes this more viable, too.)

If you want to choose a language so as to avoid any need to examine the traits
of particular frameworks so that you don't run into a heavy-magic one, you are
going to need a much more limited language than C#.

> What's the point of using a compiled language if half your code is a dynamic
> viewbag of string keys and liberal JSON parsers that just ignore fields it
> doesn't expect or can't fill?

The point is the other half of the code. (The part that, in Python or Ruby you
might be tempted to drop down to a C or Java [for JRuby] extension to do.)

------
daigoba66
One should note that this is the "new" ASP.NET. The old version, the one
explicitly tied to IIS, is not and will probably never be open source
software.

They're building a new stack from the ground up. Which is the only way,
really, to make it "cross platform".

~~~
soundoflight
The old one was open sourced a couple months (years?) back and is on CodePlex.
[http://aspnetwebstack.codeplex.com/](http://aspnetwebstack.codeplex.com/)

~~~
daigoba66
Not quite: that's "ASP.NET MVC", the razor view engine, "web pages", and some
other libraries like Entity Framework and SignalR. Technically these are just
libraries built on the closed-source ASP.NET stack, colloquially known as
System.Web, which is essentially IIS.

~~~
reddiric
It's at least available to view the source:

[http://referencesource.microsoft.com/System.Web/xsp/system/W...](http://referencesource.microsoft.com/System.Web/xsp/system/Web/UI/Page.cs.html#System.Web/xsp/system/Web/UI/Page.cs#a7e11608d83dac42)

~~~
bad_user
That's not open-source.

------
moskie
The URL of that link is a pretty surprising thing, in and of itself.

~~~
georgemcbay
Parts of Microsoft have been using github for quite a while now:

[https://github.com/msopentech](https://github.com/msopentech)
[https://github.com/Azure](https://github.com/Azure)

The Azure SDK has been there since 2012.

I agree that even now it still seems kind of odd when Microsoft embraces open
source technologies, and the company is very big so their support tends to be
oddly lumpy (generally better among the groups working on products that are
directly related to networking like ASP.NET, Azure, etc) but they've been on
this path for quite a while now.

~~~
steveklabnik
Reactive extensions too: [https://github.com/Reactive-
Extensions](https://github.com/Reactive-Extensions)

------
WoodenChair
Is this snippet of code bad? I was just randomly browsing
[https://github.com/aspnet/KRuntime/blob/dev/src/Microsoft.Fr...](https://github.com/aspnet/KRuntime/blob/dev/src/Microsoft.Framework.DesignTimeHost/ApplicationContext.cs)

    
    
            private bool IsDifferent(ConfigurationsMessage local, ConfigurationsMessage remote)
            {
                return true;
            }
    
            private bool IsDifferent(ReferencesMessage local, ReferencesMessage remote)
            {
                return true;
            }
    
            private bool IsDifferent(DiagnosticsMessage local, DiagnosticsMessage remote)
            {
                return true;
            }
    
            private bool IsDifferent(SourcesMessage local, SourcesMessage remote)
            {
                return true;
            }

~~~
davidfowl
I should have put a TODO in there :)

~~~
pmelendez
It happens in the best families... :)

------
turingbook
Some clarification: This seems to be only for demos and samples, not really
the home of source code to cooperate on.

“The Home repository is the starting point for people to learn about ASP.NET
vNext, it contains samples and documentation to help folks get started and
learn more about what we are doing.” [0]

“The GitHub issue list is for bugs, not discussions. If you have a question or
want to start a discussion you have several options:

\- Post a question on StackOverflow \- Start a discussion in our ASP.NET vNext
forum or JabbR chat room [1]

ASP.NET vNext includes updated versions of MVC, Web API, Web Pages, SignalR
and EF... Can run on Mono, on Mac and Linux. [2]

MVC, Web API, and Web Pages will be merged into one framework, called MVC 6.
MVC 6 has no dependency on System.Web. [3]

[0] [https://github.com/aspnet/Home](https://github.com/aspnet/Home)

[1]
[https://github.com/aspnet/Home/blob/master/CONTRIBUTING.md](https://github.com/aspnet/Home/blob/master/CONTRIBUTING.md)

[2] [http://blogs.msdn.com/b/dotnet/archive/2014/05/12/the-
next-g...](http://blogs.msdn.com/b/dotnet/archive/2014/05/12/the-next-
generation-of-net-asp-net-vnext.aspx)

[3] [http://blogs.msdn.com/b/webdev/archive/2014/05/13/asp-net-
vn...](http://blogs.msdn.com/b/webdev/archive/2014/05/13/asp-net-vnext-the-
future-of-net-on-the-server.aspx)

------
githulhu
Not all of ASP.NET though...notably absent: Web Forms.

~~~
eftpotrm
Trust me; that's a good thing. Nasty, deeply misguided platform - whoever came
up with the idea of PostBack and trying to make the web look like VB6 is
_definitely_ not on my Christmas card list. Ties you in knots trying to make
the web something it fundamentally isn't.

I'll be quiet now, and get back to working on my MVC code. The day when I can
finally stop having to work on WebForms code too will be a happy one :-)

~~~
graycat
Not a rhetorical question: What's so wrong with Web Forms?

Postback? That's really part of HTTP. What the browsers send back to the
server is as specified by HTTP, not Microsoft or Web Forms.

Viewstate? Okay, it's a bit of a tricky thing, but really can mostly ignore
it. Else it provides a somewhat useful service.

Controls? Yes, for each HTML 'control', there is an ASP.NET class so to send
the HTML for the control to the user, get an instance of the class
corresponding to the control, assign values to the properties, attach the
instance to a big tree that gets walked by the code in one of the ASP.NET
'events', maybe PAGE_PRERENDER, and move along. Why is this so bad?

Web Forms is my first and so far only way I've written Web pages. Explain what
is wrong with Web Forms and what is much better and why?

~~~
flomo
IMO, there was nothing horribly wrong with WebForms itself when it was
introduced -- So long as you were writing your HTML by hand and using
HtmlControls rather than the drag-n-drop stuff.

ViewState was far better than other frameworks that shoved the client state
into a server session object and _broke the Back button_. Plus the clients
were saving state instead of wasting server memory. If it got too ugly, you
didn't even have to use it, the http variables were still there.

Remember this was all designed back when Netscape 4 was a popular browser and
any Javascript was considered exotic. Of course we have much better way to do
things now, the WebForm approach broke down hard as soon as it encountered
AJAX. But originally it was fine.

~~~
UweSchmidt
There are AJAX controls for webforms, so it hasn't really "broke[n] down
hard"?

Drag an AJAX control on the form, and whatever is in there, that part of the
page will be ajaxed.

~~~
flomo
I should have added a disclaimer that I haven't worked with web forms in many
years, so my commentary is probably not the most infomred. The ajax controls
always seemed a bit ugly to me.

------
dev360
Is this admission that codeplex is dead?

~~~
kayone
I don't think so, the ASP.NET team has been releasing code to github for
while. same as azure, most of their SDK was released to github,

I don't think there is a mandate for all MS project to be on codeplex which is
somewhat surprising.

------
MrRed
But why are they looking if their code runs on Mono [1] ?

[1]
[https://github.com/aspnet/FileSystem/blob/dev/src/Microsoft....](https://github.com/aspnet/FileSystem/blob/dev/src/Microsoft.AspNet.FileSystems/PlatformHelper.cs)

~~~
getsaf
[http://www.hanselman.com/blog/IntroducingASPNETVNext.aspx](http://www.hanselman.com/blog/IntroducingASPNETVNext.aspx)
"... Oh, and by the way

ASP.NET vNext (and Rosyln) runs on Mono, on both Mac and Linux today. While
Mono isn't a project from Microsoft, we'll collaborate with the Mono team,
plus Mono will be added to our test matrix. It's our aspiration that it 'just
work.'"

Thanks for pointing that out though, I learned something new today!
[http://msdn.microsoft.com/en-
us/library/dd642331(v=vs.110).a...](http://msdn.microsoft.com/en-
us/library/dd642331\(v=vs.110\).aspx)

------
V-2
ICanHasViewContext :) (Mvc / src / Microsoft.AspNet.Mvc.Core / Rendering /
ICanHasViewContext.cs)

------
badman_ting
Oh, whoever did this is gonna be in big trouble. Heads are gonna _roll_.

…Hmm? What do you mean "they meant to do that"?

------
lucidquiet
Too little, too late (imo). I'll think about it again once they have visual
studio and all the good things running on *.nix.

It's too much of a pain to get anything to work with a .net project, and then
deploy on anything other than IIS.

~~~
hudo
Too little? Biggest change for ASP.NET from release of ASP.NET! "Too much of
pain" was the first (and last) thing I said when trying to configure ruby on
ubuntu. Or tried to download some app and run it.

~~~
lucidquiet
I guess all those thousands of Rails apps running on Ubuntu had some kind of
magic or secret knowledge to get that working. Going open source and posting
some libs on Github is 'Huge'? That's kind of funny considering how much is
out there, top notch, and did it way before MS did, and yet, it wasn't "huge"
for them.

~~~
jf22
Its huge because MS has never embraced open source like they are now.

Flying cars would be pretty huge even though planes have already been flying
for a while...

