MSBee - missing a crucial step

Topics: For MSBee Users
Aug 16, 2006 at 10:55 PM
migrated from power toy forums
originally posted by Borki
------------------------------------------------------

Just finished reading through the Docs for MSBee. I seem to miss a step:

I have a working 1.1 project (it is custom version of the ASP DotNetNuke project), that I use within VS 2003 on an old machine that is to be retired. This project has a .sln and a .vbproj file.

On the new machine I have VS2005. I can have it convert the project to Dotnet 2.0 (whic causes lots of errors).

How do I get a MSBuild file suitable that utilises the dotNet 2 tools but tragets 1.1?

Can I just convert the vbproj file to MS Build? How?

This is unrelated, but how does one debug a project when you use the Cmdline Compiler/MSBuild and you are only used to Visual Studio's debugger invokation?

Any suggestions appreciated...
Aug 16, 2006 at 10:55 PM
originally posted by Craig Lichtenstein - MSFT
------------------------------------------------------

When you open a VS 2003 solution or project file in VS 2005, the conversion wizard should ask if you want to convert the project to the VS 2005 format. Once you convert the project, you can proceed by following the instructions in sections 4.1 and 4.2 in the ReadMe document. I've pasted the instructions below; please let us know if you're still unclear on how to proceed.

Also, while I haven't used the DotNetNuke project, you mentioned that it's an ASP project. Are there any projects in the solution besides the .vbproj? MSBee doesn't support ASP projects - some people have had success by using the ASP team's recently release MSBuild project files with MSBee. The Web applications project beta release is available at: http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/

4.1 MSBee targets in migrated VS projects

To build projects using MSBee targets and tasks, and thus produce a .NET 1.1 assembly, a user needs to add an import element for the appropriate MSBee language-specific .targets file in the VS project file. The location of the import element is significant since the imported MSBee .targets file contains altered versions of targets that already exist in the corresponding MSBuild .targets file. For MSBuild to use the MSBee versions of the targets, these targets must be imported after their counterparts in the MSBuild .targets file. Thus, the MSBee .targets file must be imported after the MSBuild .targets file is imported. This behavior applies to all MSBuild elements; when using properties, for example, the last value assigned to a property is the value of the property for the entire processing of the project.

The import statement for the MSBee .targets file includes two conditionals, both of which control whether the import actually occurs. One condition checks if the “TargetFX1_1” property is set to true. The other condition checks that the “BuildingInsideVisualStudio” property is set to false. The purpose of these is to only import the .targets file when the user wants to target .NET 1.1 and is running MSBuild from the command line.

4.2 Importing MSBee targets

To import an MSBee .targets file in a VS project file, find the import element for the MSBuild .targets file. For a VB project, the line you are looking for is shown below.

<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />

Immediately under this line, insert the MSBee language-specific target file. For a VB project, you will want to insert the line below.

<Import Project="$(MSBuildExtensionsPath)\MSBee\MSBuildExtras.FX11.VisualBasic.targets" Condition=" '$(BuildingInsideVisualStudio)' == '' AND '$(TargetFX11)'=='true'" />
Aug 16, 2006 at 10:56 PM
originally posted by Craig Lichtenstein - MSFT
------------------------------------------------------

As to your second question, I'd suggest asking that in the Visual Studio MSBuild forum
Aug 16, 2006 at 10:56 PM
originally posted by Marcus Widerberg
------------------------------------------------------

If the scenario is that you have one project that you do not want to migrate from vs.net 2003 to vs.net 2005, yet build all using msbuild, I have created a task that runs the conversion step from msbuild (converts on the fly).

You can find it here: http://mawi.org/MsBuildVSNET2003ConversionTask.aspx

(This obviously only works if the conversion works w/o issues)
Aug 16, 2006 at 10:56 PM
originally posted by DanielStruve
------------------------------------------------------

so this is a way to load a project in vs 2005 and not convert it to 2005?
Aug 16, 2006 at 10:56 PM
originally posted by DanielStruve
------------------------------------------------------

well, found out it doesnt do web projects just class libraries. :(

wish I could find out how to reference a web project after it has been converted and built.