Feeds:
Posts
Comments

Our team uses Neutron inside our main product ReviewBasics. That is a really big Visual Studio 2005 solution (55+ projects), including several Neutron projects. In other words, our team is “building next generation Rich Internet Applications that combine Flash on the front-end and .NET on the server-side”, as the home page of Neutron website says.

Currently our flash front-end uses some quite big 3rd-party AS2 libraries which are referenced to Neutron projects (see the note below). The classes within the libraries participate in code complete operations, so it takes some time for IntelliSense database initialization while the project is loading.

Note: Neutron supports Zip reference feature that allows you to link an external library as a zip file, and Neutron automatically unzips and references classes within.

Actually, such possibilities are not needed for our server-side .NET part of the team. Most of them never touch the AS2.0 code. All they need is to compile this code while rebuilding the entire solution.

Well, that can be easily switched off. To disable IntelliSense database creation on project loading go to ‘Tools’ -> ‘Options’ in the main Visual Studio 2005 menu. Select ‘Projects and Solutions’ -> ‘Neutron Project Settings’ in the appearing Options dialog, and uncheck ‘Enable IntelliSense’ checkbox. Next time the projects will be loaded without IntelliSense initialization phase.

In addition, on this option page you can set the path, where MTASC compiler is located. That can be useful if you want to compile with HAMTASC instead. See How To: Substitute MTASC with HAMTASC tutorial.

Also, you can manage cache directory for ZIP references used in your Neutron project.

Enjoy!

 

~ Dmitry

Working on new Neutron installer (which is not MSI based due to some troubles related to Vista UAC system) I had to install the assembly into the GAC without using gacutil.exe. I mean programmatically.

I googled some blog posts on this subject. The first article proposed to use Windows Installer. From my point of view it is too complicated. After that I read about programmatic modifying the GAC with the Fusion APIs (C++ example and managed one). Smells like a hack. Rejected as well.

And then I found the awesome post which describes a really good solution of my problem: you can use System.EnterpriseServices.Internal.Publish class to install your assembly into the GAC and uninstal it back!

You just need to write a line of code:

new System.EnterpriseServices.Internal.Publish().GacInstall(”myassembly.dll”);

Enjoy!

~Dmitry

About a month ago Aaron Marten wrote a post “CTC is dead…Long Live VSCT! (Part 1)” where he announced a new XML-based format called VSCT, which is far easier to work with than CTC. Two weeks ago James Lau announced VS SDK for Orcas Beta 1 (April CTP). One of the improvements of April CTP is that command table configuration (.ctc) files have been deprecated in favor of XML command table (.vsct) files and all samples that used .ctc files have been converted to use .vsct files.

Well, that is good but it is done for Visual Studio Codename Orcas only. The latest VS SDK 4.0 RTM for Visual Studio 2005 announced a little bit earlier still uses CTC but it includes VSCT compiler in pre-release state. You can find it here: C:\Program Files\Visual Studio 2005 SDK\2007.02\Prerelease\.

This post demonstrates how to add VSCT support for Whidbey (VS 2005) projects.

To demonstrate this we will use the C# Reference.MenuAndCommands sample included into Visual Studio SDK Version 4.0. You can find it in that directory: C:\Program Files\Visual Studio 2005 SDK\2007.02\VisualStudioIntegration\Samples\IDE\CSharp\Reference.MenuAndCommands\. At the end of this tutorial, we will get this sample working with VSCT instead of CTC. Follow instructions below.

1. Before we will substitute CTC with VSCT let’s see how it looks now. Press F5 to run the MenuAndCommands sample in experimental hive and see some menu items added under main menu item ‘Tools’. Note command ‘C# Command Sample’ – it will be our marker in this tutorial.

Before (with CTC)
 
2. The first thing we should care about is to obtain VSCT analogue for our CTC file. The easiest way to do that is to build the project to get .cto file compiled from current .ctc file and then create a .vsct file from an existing .cto file using VSCT.exe utility. I have used the following command to perform the conversion from <project_root>\obj\Debug\ directory where two input files PkgCmd.cto and PkgCmd.ctsym are located.

>   “C:\Program Files\Visual Studio 2005 SDK\2007.02\Prerelease\VSCT\VSCT.exe” PkgCmd.cto PkgCmd.vsct -SPkgCmd.ctsym

3. Now let’s replace CTC part of the MenuAndCommands sample project with VSCT analogue. Create new folder VSCTComponents under project root directory and copy just generated PkgCmd.vsct file from obj\Debug\ there. Then make it part of the project. To be sure that we have no CTC here let’s remove all from CtcComponents folder except image GenericCmd.bmp, because it is still needed. Let’s also replace the text of the button ‘C# Command Sample’ with ‘C# Command Sample (VSTS)’ to have some differences in resulting UI. See what we have now.

Change the button text to have a visual marker
 
Note: you can easily add IntelliSense for .vsct files via browsing for C:\Program Files\Visual Studio 2005 SDK\2007.02\Prerelease\VSCT\VSCT.xsd file in ‘Schemas’ property in Properties window (accessible by F4).

4. Rebuild the solution and then execute ‘devenv.exe /rootsuffix Exp /setup’ command to refresh Visual Studio UI. Then press F5 to see the result – all menus disappeared. To get all back in VSCT incarnation of menu items we need to write some code right in MenuAndCommands.csproj project file. To do that unload the project and open it for editing using ‘Edit MenuAndCommands.csproj’ command.

Open project file for manual editing

5. Add the following line importing .targets file as it is shown on the picture below. I have prepared the VSCT_overrides.targets file, so you just need to download it and save in the project root directory.

Import .targets file containing overriden MSBuild targets

6. Now our PkgCmd.vsct file declared as <None Include=”VSCTComponents\PkgCmd.vsct” /> in MenuAndCommands.csproj file. Replace this line with the following code. Child node ResourceName specifies the name of CTO object which will be merged into assembly resources with.

Use VSCTCompile tag for .vsct file
 
7. Save the changes and reload the project. Select ‘Load project normally’ option in the Security Warning dialog which will be appeared. Rebuild the project and see results in output window. There are 4 errors that occurred due to automatic generation.

Four errors of automatic VSCT file generation shown in Visual Studio Output window

Note: make sure you use ‘Normal’ level of MSBuild build output verbosity.
 
8. You can easily fix them by adding 4 IDSymbol tags under according GuidSymbol tags or just download fixed version of PkgCmd.vsct file I have prepared. Then build the project again and verify that all errors go on.

VSCT file compiled with no errors
 
9. Rebuild the solution and then execute ‘devenv.exe /rootsuffix Exp /setup’ command to refresh Visual Studio UI. Then press F5 to see the result – menus appeared again. Note the changed text ‘C# Command Sample (VSTS)’.

After (with VSCT)

Enjoy!

~Dmitry

SharpStyle Neutron uses excellent open source ActionScript compiler called MTASC developed by Nicolas Cannasse. Click here to read Comparison with Macromedia ActionScript compiler. But if you are an advanced ActionScript developer, you might also be familiar with HAMTASC. SharpStyle Neutron makes it very easy to substitute one compiler with another.

This tutorial will demonstrate how to substitute MTASC with HAMTASC.

Actually, it is very easy in Neutron. There are a few steps to do:

1. Open Hello World sample in Visual Studio 2005 and compile it. As you can see in Output window screenshot below, HelloWorld project has been successfully built with MTASC:

Compilation result in Visual Studio Output window

2. Now let’s substitute MTASC with HAMTASC compiler. You can set the path to the compiler in Visual Studio under Tools -> Options -> Projects and Solutions -> ActionScript Project Settings -> MTASC path. Browse the HAMTASC executable file mtasc.exe and then press OK to apply the changes. 

Tools -> Options -> Projects and Solutions -> ActionScript Project Settings -> MTASC path 

3. Build the project again, but this time with HAMTASC compiler:

Compilation result in Visual Studio Output window

4. As you might know HAMTASC uses some additional compilation options, which can be added to compilation command thanks to Neutron Project Properties:

HelloWorld project Project Properties in Visual Studio 

Enjoy!

 

~ Dmitry

New beta release

If you are interested in joining Neutron Beta group, please email us: neutron@sharpstyle.com

 

This release includes the following fixes/enhancements:

  • Fixed: Visual Studio would freeze when compiling a large project
  • Fixed: Go to Definition for functions with parameters didn’t make correct selection
  • Fixed: multiple Zip files with same name will cause issues
    • Neutron supports Zip reference features that allows you to link an external library as a zip file and Neutron automatically unzips and references classes within. If you had multiple projects referencing zip file with the same name, AS classes would be unzipped into the same folder. This release resolves this issue
  • Fixed: HTML template file validation in Project Properties->Run for ‘Run in default application … ’ option
  • Compilation process now shows output line by line
  • Parsing performance optimization — significant improvements when parsing large libraries to display IntelliSense 
  • Added checkbox to enable/disable IntelliSense
  • Added default empty class to ActionScript Library template
  • Added UI for changing the Zip reference cache path and clearing cached libraries (under Tools->Options->Projects’n’Solutions->ActionScript Project Settings->Reference Cache)
  • Added browse button for “main class” in Project Properties
  • Other minor bug fixes and changes

 

~Mike

http://www.gotoandlearn.com/download.php

I didn’t watch all of them, but those few that I watched are done very well.

 

~Mike

 

~Mike

Follow

Get every new post delivered to your Inbox.