webmatrix安装_上下文中的Microsoft WebMatrix和部署您的第一个站点

webmatrix安装

webmatrix安装

 ScottGu announced Microsoft WebMatrix Beta today.

ScottGu今天宣布了Microsoft WebMatrix Beta。

  • WebMatrix Starting Page
  • It has a small embedded file-based SQL Database, and a web-server called IIS Express that's compatible with the full version of IIS.

    它具有一个小的基于嵌入式文件SQL数据库,以及一个与IIS的完整版本兼容的称为IIS Express的Web服务器。
  • It uses a View Engine called "Razor" to make Web Pages, and your sites can be later be expanded to use all of ASP.NET MVC. It's a simple syntax that is easy to learn

    它使用称为“剃刀”的View Engine制作网页,以后可以将您的网站扩展为使用所有ASP.NET MVC。 这是一个简单易学的语法
  • It uses the WebDeploy engine to deploy apps to hosts, setting up permissions, copying databases, etc.

    它使用WebDeploy引擎将应用程序部署到主机,设置权限,复制数据库等。
  • WebMatrix also has the Search Engine Optimization Toolkit built in, so you can spider your own site and see how Search Engines see it. It'll make recommendations and store reports.

    WebMatrix还内置有“搜索引擎优化工具包” ,因此您可以搜索自己的网站并查看搜索引擎如何看待它。 它将提出建议并存储报告。

I've said before that Microsoft is just now starting to get the "right-sized LEGO pieces." It the past some stuff was too little or too big, but now as an example, here's five separate and right-sized LEGOs (ya, I know it's singular) that are helpful for the professional and the folks just getting starter, or those who don't want to learn a bunch of stuff to setup and/or modify a website.

我之前说过,微软现在才开始获得“大小合适的乐高积木”。 过去,有些东西太少或太大,但现在举个例子,这里有五个单独的,大小合适的乐高积木(是的,我知道这是单数的),对专业人士刚入门的人或那些不想学习很多东西来设置和/或修改网站。

Visual Studio 2010 looks like a dashboard. It's big and powerful and overwhelming. I tried to get my wife, then later my 10 year old nephew to make a website and it was a non-starter. It worked later with WebMatrix. This isn't for professionals, even though it has components that professionals will use. Pros will like a free file-based SQL Server, and a non-service version of IIS that's more compatible than the Visual Web Developer, and pros might like using Razor as an alternative View Engine for their ASP.NET MVC sites.

Visual Studio 2010看起来像一个仪表板。 它既强大又强大,势不可挡。 我试图找我的妻子,后来又让我10岁的侄子建立了一个网站,这是一个初学者。 后来与WebMatrix一起使用。 尽管它具有专业人员可以使用的组件,但它不适用于专业人员。 专业人士会喜欢免费的基于文件SQL Server,以及比Visual Web Developer更兼容的IIS的非服务版本,专业人士可能会喜欢使用Razor作为ASP.NET MVC网站的替代View Engine。

However, folks that are starting out, or hobbyists, or maybe just installing a blog or forum will use WebMatrix to get stuff done.

但是,刚开始的人们,业余爱好者,或者只是安装博客或论坛,都将使用WebMatrix完成工作。

下载并安装矩阵 (Download and Install Matrix )

Here's how you'd get WebMatrix, sign up for a new host, and deploy your first site.

这是获取WebMatrix ,注册新主机并部署第一个站点的方法。

Go to the WebMatrix site and click Download Now. It'll install the Web Platform Install (about 2 megs) and then you click Install. The WebMatrix download for me was 8megs, then SQL Compact was 2.5megs, and then some deployment dependencies brought my total download to 29 megs.

转到WebMatrix网站,然后单击立即下载。 它会安装Web Platform Install(大约2兆),然后单击Install。 对我而言,WebMatrix的下载量为8兆字节,而SQL Compact的下载量为2.5兆字节,然后一些部署依赖性使我的总下载量达到29兆字节。

运行并选择一个站点 (Run and Select a Site )

You can install a site from the Gallery, like ScottGu did when he chose BlogEngine.NET. These are regular ASP.NET and PHP apps that you've probably used before. There's lots of Open Source apps like Blogs (like DasBlog, that runs this site!), Content Management Systems (like Umbraco, that powers http://asp.net!) and other apps that you can start working with immediately.

您可以从Gallery中安装站点,就像ScottGu在选择BlogEngine.NET时所做的那样。 这些是您以前可能使用过的常规ASP.NET和PHP应用程序。 有很多开源应用程序,例如Blogs(如运行该站点的DasBlog!),Content Management Systems(如为http://asp.net供电的Umbraco)以及其他可以立即使用的应用程序。

However, since we're learning, my wife and I are going to select Site from Template and pick the Bakery App. This is a basic store-type application that we can deploy in just a few minutes. We don't need to look at code if we don't want to.

但是,由于我们正在学习,所以我和我的妻子将从模板中选择站点,然后选择Bakery App。 这是一个基本的商店类型应用程序,我们可以在几分钟内完成部署。 如果我们不想的话,我们不需要看代码。

Hit OK and I'm in WebMatrix looking a new screen.

单击确定,我在WebMatrix中查找新屏幕。

At this point I can click Run to see my app.

此时,我可以单击“运行”以查看我的应用程序。

It's running locally on IIS Express along with some others Apps I was looking at earlier. This is effectively FULL IIS (not Visual Web Developer) but installed as a User App...when I stop the app, it's gone. It's not an auto-startup service, but it is IIS, which means your apps will run the same locally as they do deployed.

它与我之前看过的其他一些应用程序一起在IIS Express上本地运行。 这实际上是FULL IIS(不是Visual Web Developer),但是作为用户应用程序安装了...当我停止该应用程序时,它就消失了。 它不是自动启动服务,而是IIS,这意味着您的应用程序将在本地与部署时相同地运行。

I can run it locally, but how do I get it up to a host?

我可以在本地运行它,但是如何将其安装到主机上呢?

将我的应用程序部署到主机 (Deploying My App to a Host)

Things usually get complicated when you go to deploy and app. It's pretty easy to get an application running locally, but it's sometimes a challenge to get that app up on a site. People can sign up for a Gmail or Hotmail account and get that running, so why can't they get a website up that they coded themselves?

当您去部署和应用程序时,事情通常会变得复杂。 使应用程序在本地运行很容易,但是在站点上启动该应用程序有时是一个挑战。 人们可以注册Gmail或Hotmail帐户并使其运行,那么为什么他们不能建立自己编写的网站呢?

I've blogged about WebDeployment before and shown examples in my Mix Video "If you're using XCopy you're doing it wrong." WebDeploy is part of WebMatrix also.

我之前写过有关WebDeployment的博客,并在我的混合视频中显示了示例:“如果您使用XCopy,那么您做错了。 ” WebDeploy也是WebMatrix的一部分。

I'll click on Publish and "Find Web Hosting" and I get a list of hosts I can choose from. I'll select Applied Innovations and click Learn More. I do prefer hosts like AdHost that give you both a .NET 2 and .NET 4 Application Pools to work in, which means I can use apps from the Gallery and apps that use the new Razor Syntax at the same time.

我将单击“发布”和“查找虚拟主机”,然后获得可供选择的主机列表。 我将选择“应用创新” ,然后单击“了解更多”。 我确实喜欢像AdHost这样的主机,它们可以为您提供.NET 2和.NET 4应用程序池,这意味着我可以同时使用Gallery中的应用程序和使用新Razor语法的应用程序。

I go to Applied Innovations, and fill out the form. I'll get free hosting until next year with 1 GB of Disk Space and 100 GB monthly transfer. I get .NET 3.5 and 4, but also PHP. I can use SQL Compact, but also mySQL.

我转到“应用创新” ,然后填写表格。 明年之前,我将获得免费托管,并提供1 GB的磁盘空间和100 GB的每月传输量。 我得到.NET 3.5和4,还有PHP。 我可以使用SQL Compact,也可以使用mySQL。

I fill out a form -  no credit card needed - and they send me an email. Click a link and they send me back an email with all the details I need. This is the same experience you'll get with all the hosters.

我填写了一张表格-不需要信用卡-他们会给我发送电子邮件。 单击一个链接,他们会给我发回一封电子邮件,其中包含我需要的所有详细信息。 这是您与所有托管服务商所获得的相同体验。

My Opinion: Some hosts make you switch your AppPools between .NET 2 and .NET 4 and that's too hard for beginners, I think. Hopefully all the hosters will remove this step and offer two app pools, or make switching between them a top level button in their Control Panels. AdHost does this. I hope others will also.

我的观点:有些主机使您可以在.NET 2和.NET 4之间切换AppPool,对于初学者来说,这太难了。 希望所有主机托管者都可以删除此步骤,并提供两个应用程序池,或者使它们之间的切换成为其控制面板中的顶级按钮。 AdHost会这样做 我希望其他人也会。

To switch to .NET 4, go to the Control Panel URL in your welcome email. Click WebSites, Extensions and select ASP.NET 4 from the dropdown.

要切换到.NET 4,请转到您的欢迎电子邮件中的“控制面板” URL。 单击“网站”,“扩展”,然后从下拉列表中选择“ ASP.NET 4”。

Other hosts to choose from during this Beta are:

在此测试版中可以选择的其他主机是:

I fill out the Publish Form in WebMatrix with the details direct from my new host.

我直接在新主机上填写WebMatrix中的发布表单。

Notice I don't need to do anything special for my database, as it's a file-based SQL database, runs in Medium Trust and requires no configuration.

注意,我不需要为数据库做任何特殊的事情,因为它是基于文件SQL数据库,可以在Medium Trust中运行,并且不需要任何配置。

Click Publish, and I'll get a list of files that'll be copied up. This is a differential copy, so if you change one file later, only that file will go up. Be sure to click the checkbox to deploy your database.

单击发布,我将获得将要复制的文件的列表。 这是一个差异副本,因此,如果您以后更改一个文件,则只会显示该文件。 确保单击复选框以部署数据库。

The publish happens in the background...

发布发生在后台...

Then it completes, and I can now visit my new Bakery site online at my host, AppliedI:

然后完成,现在我可以在我的主持人AppliedI在线访问我的新Bakery网站

Of course, if I wanted to, I could change the site, maybe modify the Products page:

当然,如果需要,我可以更改站点,也可以修改“产品”页面:

@{
LayoutPage = "~/_Layout.cshtml";
PageData["Title"] = "Product";

var db = Database.Open("bakery");
}

<h2>Available Products:</h2>
<div class="products group">
@foreach (var p in db.Query("SELECT * FROM PRODUCTS")) {
<div class="product">
<h3>@p.Name</h3>
<img src="@Href("~/Images/"+ p.ImageName)" alt="@p.Name"/>
<p>@p.Description</p>
<ul class="group">
<li class="price">$@string.Format("{0:f}", p.Price)</li>
<li class="order">
<form action="Order" method="post">
<input type="hidden" name="ProductId" value="@p.Id"/>
<input type="submit" value="Order Now"/>
</form>
</li>
<ul>
</div>
}
</div>

There's lots of nice helpers for Google Analytics and Twitter integration:

Google Analytics(分析)和Twitter集成有很多不错的帮助器:

<div class="sidebar">
@Twitter.Search("#bakery", caption: "#bakery")
</div>
I could of course, also edit my data:

All in a reasonably not scary-dashboard looking UI. It's all ASP.NET underneath, so I can graduate to ASP.NET MVC and move my logic into controllers, and I've already got Views written in the "Razor" syntax, which is the new default for ASP.NET MVC 3.

一切都在一个看上去并不可怕的仪表板用户界面中。 它全部位于ASP.NET之下,因此我可以升级到ASP.NET MVC并将逻辑移到控制器中,并且我已经用“ Razor”语法编写Views,这是ASP.NET MVC 3的新默认设置。

语境 (Context)

If you're reading this blog, and you're not my Wife, this tool probably isn't for you. (Hi, wife.)

如果您正在阅读此博客,并且您不是我的妻子,则此工具可能不适合您。 (嗨,老婆。)

However, the pieces that make up WebMatrix probably are. SQL Compact is pretty sweet. It's small, free, file-based and easy to upgrade to SQL Express Big Boys and Girls Edition. The new Razor syntax is a nice alternative to the WebForms Syntax (as are other alternative ViewEngines). IIS Express is hotness, especially if you've ever had an app that acted differently on IIS than on Visual Web Developer.

然而,构成WebMatrix中的碎片可能是。 SQL Compact非常不错。 它体积小,免费,基于文件,易于升级到SQL Express Big Boys and Girls Edition。 新的Razor语法是WebForms语法的不错替代品(其他ViewEngine也是如此)。 IIS Express非常热门,特别是如果您曾经有一个应用程序在IIS上的行为不同于在Visual Web Developer上的行为。

If you are learning web development or just want to get a site up, check out WebMatrix. Even if you don't edit the code, you can get and deploy and app to a host quickly, be it an ASP.NET app or a PHP app. If you do choose to write an app yourself, you can get started with WebMatrix and then move to Visual Studio (Free Express or $ Pro) if you outgrow it.

如果您正在学习Web开发或只是想建立一个网站,请查看WebMatrix。 即使您不编辑代码,也可以快速将其部署并部署到主机,无论是ASP.NET应用程序还是PHP应用程序。 如果确实选择自己编写一个应用程序,则可以从WebMatrix开始使用,如果超出了该范围,则可以转到Visual Studio(Free Express或$ Pro)。

I'll report back and see what the WAF (Wife Acceptance Factor) is on WebMatrix.

我将进行报告,并查看WebMatrix上的WAF(妻子接受因子)。

Related Links

相关链接

翻译自: https://www.hanselman.com/blog/microsoft-webmatrix-in-context-and-deploying-your-first-site

webmatrix安装

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值