BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
I converted the core project and accounts modules to asp.net 2. The only problem i encountered was the XslTransform is now obsolete. I can't figure out how to change it to use the new class xslcompiledtransform
But I recommend getting rid of that nasty Nav box all together. That doesn't look like a typical web navigation control, it's on the wrong side of the page, and is generally ugly.
ASP.NET 2.0 has some great navigation controls. Look into the SiteMap and Menu controls.
When converting the project to asp.net 2 I can't figure out how to fix this casting issue. In the past I just had to ensure that the base.OnInit(e); came first in the OnInit method. However this is the case even with a fresh install of ThePhile being converted with VS2005 I get the following error everywhere this cast occurs.
An unexpected error has occurred on this page. The system administrators have been notified. Please feel free to contact us with the information surrounding this error.
The error occurred in: http://localhost/ThePhile/Modules/Ne...ategories.aspx
Error Message: Unable to cast object of type 'System.Security.Principal.GenericPrincipal' to type 'Wrox.WebModules.Accounts.Business.PhilePrincipal' .
--------------------------------------------------------------------------------
Stack Trace:
System.InvalidCastException: Unable to cast object of type 'System.Security.Principal.GenericPrincipal' to type 'Wrox.WebModules.Accounts.Business.PhilePrincipal' . at Wrox.WebModules.NewsManager.Web.Categories.Page_Lo ad(Object sender, EventArgs e) in c:\wrox\ThePhile\Modules\NewsManager\Admin\Categor ies.aspx.cs:line 24 at System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Has anyone else come across this problem? Thanks in advance for any help.
This has nothing directly to do with 2005, but this is caused by mismatched DLL versions, or else bad references.
To upgrade to a from version 1.0 to 1.1 (this is not directly applicable to 2.0), the basic compilation model is the same, so you could rebuild the projects piecemeal. You could first delete ALL the .dll and .pdb files because they were built on your old version. This has the unfortunate side-effect of breaking all your references! As you know, you can't compile without having all your references in place for the project you are now compiling.
Which leads to the question: which project can be compiled that has no dependencies on any other project in the solution? That's the one you need to compile first. Then you can fix the reference that any other projects have on that .dll, and you can compile them (assuming they don't need others that you haven't compiled yet). If you're careful you can do this process to build upon any .dlls you already built, and soon you'll have a whole working solution.
What about 2005? The problem is that the basic compilation model changed, and the manner in which projects are handled is now different. In fact, there are no projects - at least not in the way that you know them now. Projects are now just folders, and there is no .dll that belongs to one project. Each page compiles to a separate DLL now, and the way references are handled is different because of this.
The new app_code folder is a common folder that holds common code, and this is compiled and referenced automatically.
This makes it hard to port a complex application made in earlier versions of ASP.NET. For this reason, a lot of companies complained to Microsoft, and Microsoft listened! They'll introduce a new (and optional) project model soon that is quite similar to the old model. This will make it easier to port old applications.
I guess I need to just wait untill the new project model is released from Microsoft for me to continue my migration to version 2.0? Do you have any idea on the proposed release date for that?
Yay, I finally got everything working. Using Visual Studio 2005 Web Application Projects (Beta Preview). Everything works great under asp.net 2.0 without rewriting any code!
I have tryed to convert the ThephileII project to VS2005 and now I get this error.
The application for the project http://localhost/ThePhileII.csproj is not installed
make sure the application for the project type (.csproj) is installed