Announcing web features in Visual Studio “14” CTP

Announcing web features in Visual Studio “14” CTP

Rate This
  • Comments 34

Today, the Visual Studio team announced the release of Visual Studio “14” CTP version 14.0.21730.1 DP.  Our team added features to support ASP.NET vNext development.  We will have future blogs to talk about some of the features in detail.  Note, Visual Studio side by side support is not available on this early build. Do not install this CTP on a machine with any other version of Visual Studio installed.

ASP.NET vNext Templates

ASP.NET vNext projects can be created using C# templates with “ASP.NET vNext” in the name.

clip_image002[1]

To generate an MVC 6 project, select “ASP.NET vNext Web Application template” and click OK.

clip_image004[1]

ASP.NET vNext Project

You can find the generated project file has a new extension “.kproj”. It looks like a normal “.csproj” file, but doesn’t contain any reference elements, and has a few other differences such as target file and project type. The project system gets most project information from the file and folder structure and the project.json file.

Checking the generated solution folder, we can see it has a packages folder containing all the packages needed for the project. It also contains a “<solutionName>.sln.ide” folder which is used by Roslyn Compiler engine to store temporary files. This folder should be excluded from the source control system normally.

The project’s property page can change the active target framework, between “.NET Framework 4.5” and “.NET Core Framework 4.5”. “.NET Core Framework 4.5” is the new cloud-optimized runtime.

clip_image006[1]

Using the project’s reference tree, you can view the package dependencies clearly, under the active target framework.

clip_image007

For library projects, the build will create dlls targeting both “.NET Framework 4.5” and “.NET Core Framework 4.5”, generating corresponding NuGet packages in the output bin folder.

For web and console projects, the build will not generate any packages or dlls.  When you deploy the project to the file system, you will see that the source code will be copied as well.  The projects are compiled and run dynamically. 

ASP.NET vNext Project.Json IntelliSense Support

To ease project.json editing, we added IntelliSense support.

clip_image008

For the dependencies object, it provides IntelliSense options by searching the NuGet server to list all the available packages and their versions.

clip_image009[1]

clip_image010[1]

clip_image011[1]

No build needed for changes to appear in browser

Thanks to the Rosyln compiler, if you change ".cs” files or project.json file and want to see the change in the browser, you don’t need to build the project any more. Just refresh the browser.

All files are included in the project

All the files and folders (except bin and obj folders) under the project folder are automatically included as project files. Any file system change under the project folder will be automatically picked up in Solution Explorer and IntelliSense get refreshed automatically.

Automatic Package Restore when modifying project.json dependencies

If you change dependencies by modifying the project.json file, the packages are automatically restored, and IntelliSense get adjusted automatically. You can check the “Package Manager Log” output window to see the action.

clip_image002[3]

Publish supports Azure website and file system

You can publish your MVC 6 project to an Azure website or the file system with a similar publishing story as before.

The following screen shot shows file system publishing after you click Publish in the context menu for the project:

1. Choose “File System” or choose an existing file system publishing profile.

clip_image013

2. Set up a local folder:

clip_image015

3. Choose Publish, after it is finished, go to the published folder, run the web.cmd file.

clip_image017

4. Examine the project.json file’s “web” command to get the URL, which in our case is http://localhost:5000. Type this URL in your browser to see the running site.

There is no IIS express, nor IIS involved when you run from the command line. It means that you can publish your website to a USB drive, and run it by double clicking the web.cmd file!

Summary

You can find more tooling details in asp.net article Getting Started with ASP.NET vNext and Visual Studio "14".

With this new tooling you can now open the existing MVC Music Store and Bug Tracker sample projects on GitHub in Visual Studio and get a full development experience. You can find instructions on how to open, build, run and publish these sample ASP.NET vNext project in the documentation for the corresponding GitHub repos.

We’d love to hear your feedback. For VS tooling related, please submit bugs through Connect; send suggestions on UserVoice and quick thoughts via Send-a-Smile in the Visual Studio IDE. For ASP.NET vNext, please provide feedback in Github or the ASP.NET vNext forum. If you ask a question in Stack Overflow, use the asp.net-vnext tag.  Thanks for being with us in this exciting time.

Leave a Comment
  • Please add 1 and 8 and type the answer here:
  • Post
  • How do I use dynamic compilation for XAML and WPF projects? Thanks.

  • @Sayed-Ibrahim, thanks for the great info!

    BTW: Loved your "Inside the Microsoft Build Engine".

    Best regards, Michael

  • Will it still be possible to have the code built with the CSC compiler.  I don't believe our legal department, or the security compliance (SOC2) would allow us to send the code (which we are so keen in locking down to only a few people in a large company has access to) across the internet to a compiler in another location.

    I see the advantage of Roslyn in many situations, including my personal development, but not in our specific example.

  • right now, we have our own Developed CMS, and we do it by creating library projects and using embedded resources in their dlls and use virtual path provider to find images, css, js etc... files

    the benefit is when we update or fix bug, all what we have to do is obfuscate the dlls, then upload them to each website.

    my questions is this still feasible in VNex ?

  • @Dude, you asked "How do I use dynamic compilation for XAML and WPF projects".  ASP.NET vNext project system is different with XAML and WPF.  You can make this suggestion to VS team in Visual Studio's UserVoice.

  • @chad,  I think Sayed-Ibrahim-Hashimi just answered your question in the reply to Michael.  I copied it here:

    @Michael regarding build support we are planning to be as consistent with existing projects as possible. When using Visual Studio a .kproj file is created. It's an MSBuild file like most other VS projects. You can think of the vNext compile/verify phase as a replacement for the CSC (C# compiler) MSBuild task. There may be some changes if you have customized the build/publish process but we are hoping to maintain as much consistency as we can. We will see some updates in the build/publish space coming later.

  • @Frenz, if you're working with JSON Schemas, you'll get an improved experience when using the latest nightly build of Web Essentials vswebessentials.com/download

    It'll add more Intellisense and integrate with http://schemastore.org

  • Do you have plans to bring the flexibility of the new .kproj to other platforms ?

    In particular, for the Node.js extension it would be very helpful to have VS discover the source tree rather than having to reference every single item in the project file to be able to edit the project with VS.

  • No build needed for changes to appear in browser - How?

    I can't see the changes by just refreshing the browser, I can edit some controller, but the results doesn't appear with a simple refresh.

    I tried running by VS, by Helios.cmd, K web... Nothing works!

    What is the secret?

  • @EduardoPires, it only works when running the website with VS,  VS will automatically detect the code changes and restart the web server.  If you do it through command line k web, you've to restart the k web yourself.  If you still have trouble with VS auto detecting the code change, please file a bug for us in github with your repro step.  Thanks!

  • Thought of pointing to this TechEd video where these features are demonstrated by Scotts. channel9.msdn.com/.../DEV-B385

    This might add more context to stuff here.

  • @Xinyang Qiu

    I tried again!

    My steps:

    I created an Azure VM based on VS14 template with Win12

    I ran the VS14 and I created a new ASP.NET vNext Web Application

    I started the web app from VS14 without changes.

    I changed the following line in HomeController.cs > IActionResult About()

    ViewBag.Message = "My application description page!!";

    I saved the file on VS14 with application running, on the browser I pressed "refresh".

    Nothing changed!

    Just for testing I ran the webapp with Helios, but the helios is dropping the application when the modified file is saved on disk.

    Any idea?

  • @EduardoPires, thanks.  For step "I started the web app from VS14 without changes.", did you start with f5?  I forget to mention that ctrl-f5 will work.  And F5 won't work since it's in debug mode and we can't just restart the session if it's in debug mode.  For Helios problem, could you please log an issue in https://github.com/aspnet/Home so that we can track it?  Thanks!

  • Your post is very informative

  • @Devmondo -

    We are working on enabling deploying just DLLs to the remote server. You can see some of this with the "k pack" command that is available in projects. Check out the project wiki for some more info: github.com/.../Package-Manager

    Thanks,

    Eilon

Page 2 of 3 (34 items) 123