MSBee and VS2005 Web Application Project Beta 2

Topics: For MSBee Users
Aug 16, 2006 at 9:25 PM
migrated from power toy forums
originally posted by Andresmdc
------------------------------------------------------

I am new to MSBee and have been attempting to get a simple (calendar control and label) ASP.NET C# 1.1 project to compile inside VS2005 using MSBee and the Web Application Project Beta 2.

I carefully read through the MSBee documentation (twice) and made sure to add the correct import project reference after the existing one in the csproj file:

<Import Project="$(MSBuildExtensionsPath) \MSBee\MSBuildExtras.FX11.CSharp.targets" Condition=" '$(BuildingInsideVisualStudio)' == '' AND '$(TargetFX11)'=='true'" />

I also double checked that the virtual directory was set up to use .NET 1.1 through IIS manager.

However, when I opened the 2005 visual studio command prompt and ran this command:

msbuild Converted3rd2005.csproj /t:Rebuild /p:TargetFX1_1=true

I get a bunch of "missing assembly" errors, like this:

Build FAILED.
Global.asax.cs(5,18): error CS0234: The type or namespace name 'SessionState' does not exist in the class or namespace 'System.Web' (are you missing an assembly reference?)

I double checked that the references inside the project all point to 1.1 dlls. What else am I missing?
Aug 16, 2006 at 9:25 PM
originally posted by Craig Lichtenstein - MSFT
------------------------------------------------------


Please bear in mind that MSBee doesn't officially support the Web Application Project Beta 2. We've just had anecdotal evidence that some people have gotten it to work.

That being said, I'd review your project for any changes caused by the VS project converter. For example, one issue we've found is that a VS 2003 project containing web references will use partial classes when converted to VS 2005. Since the v1.1 compiler wasn't designed for partial classes, build errors are produced. While you may not have a partial class problem, I'd compare your files from before and after the conversion and see if anything changed.

Secondly, I'm just wondering if the <Import Project...> element you have in your post is copied directly from your project file. If so, I noticed there's a space between $(MSBuildExtensionsPath) and \MSBee\MSBuildExtras.FX1_1..., even though there shouldn't be. Maybe that's affecting it?
Aug 16, 2006 at 9:25 PM
originally posted by petem
------------------------------------------------------

Craig,
I've encountered this.
I've got an asp.net 1.1 app that has web references.
I converted it to 2.0 (after I'd installed the latest release of Web Application Projects), and it worked fine. I then tried to compile it to 1.1 using MSBee, and it failed - due to the partial class generated in the process of converting it to a 2.0 web application project.
Can you suggest any ways to get round this issue?

Can I regenerate the reference.cs file somehow?
Will the final release of Web Application Projects perform the conversion in a different way (that doesn't lead to partial classes)?
Are there any other similar issues that crop up (conversion leads to 2.0-only features) that I need to be aware of?
Thanks in advance,
Peter.
Aug 16, 2006 at 9:25 PM
originally posted by Craig Lichtenstein - MSFT
------------------------------------------------------

As aforementioned, we don't officially support the web application projects although some people have claimed success. One thing I noticed when reviewing their documentation was that having partial classes seems like an optional step and something that doesn't happen in the converter: see this link. The key takeaways I saw were:

To migrate your code to use partial-class model, first make sure that your code compiles without errors. Then in Solution Explorer, right-click the project name and click Convert to Web Application. This command iterates through each page and user control in the project, moves all control declarations to a .designer.cs file, and adds event handler declarations to the server-control markup in the .aspx and .ascx files.

Note Another option is to use the Convert to Web Application command on individual pages. You might do this first on a few pages if you want to watch closely the changes made for each page before applying the change to the entire application.

Note The Convert to Web Application command cannot be undone in Visual Studio. The best method for reverting the changes is to restore from a backup of the Visual Studio .NET 2003 project, and then to re-run the Visual Studio 2005 migration as described in Step 4 above.

To answer your particular questions:

I believe the common technique that's been used to workaround this is to replace the partial classes that were generated during conversion with the original 1.1 code. You may try converting again
I don't know; I'd email them or post a question in their forum.
Partial classes seems to be the most common issue that's cropped up. Depending on the project type, you may have a 2.0 only namespace included after conversion. The other one that occasionally pops up is when VS adds an attribute that is 2.0 specific.