Web Application, converted from WebSite, fails to startup

Last post 06-27-2008 4:38 AM by Thomas Sun – MSFT. 1 replies.

Sort Posts:

  • Web Application, converted from WebSite, fails to startup

    06-24-2008, 11:23 PM
    • Loading...
    • andyhore
    • Joined on 06-25-2008, 3:08 AM
    • Cincinnati, OH
    • Posts 1

    Our product is a failry well established WebSite application that I want to migrate to a Web Application. All has gone reasonably well, and I've managed to get all the Profile stuff changed to WebProfile with the help of Scott Gu's tutorial. However, whenever I start the application, I get the following error:

    Compilation Error body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0246: The type or namespace name 'SearchMatchTypes' could not be found (are you missing a using directive or an assembly reference?)

    Source Error:

    Line 86: public class ProfileGroupSearchPreferences : System.Web.Profile.ProfileGroupBase {
    Line 87:     
    Line 88:     public virtual SearchMatchTypes MatchType {
    Line 89:         get {
    Line 90:             return ((SearchMatchTypes)(this.GetPropertyValue("MatchType")));

    Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\santsuite\62dc4cbb\5d4dc198\App_Code.3e7rfkgw.0.cs    Line: 88

    So, for some reason it's still compiling an App_Code file/folder that does not exist in the project. I also found the lines of code I *thought* this might be compiling in the WebProfile.vb file and have commented then out. But, it still fails! At this point, I'm totally stuck for ideas:( Any suggestions or help would be most appreciated.

     

    Oh, and may be this is related, but may be not...if I open any of my aspx files in Source mode, they give the following error in the Error List:

    Error    2    Type 'ProfileCommon' is not defined.    D:\src\sant\8_2\SantSuiteSolution\SantSuiteSolution\SantSuite\Default.aspx    1    1    SantSuite

    But, if I close the file the error goes away and everything compiles just fine. I've also checked every file in the entire solution and there is no occurrence of ProfileCommon!!! What gives on this one?

     

    Thanks,

    Andy.

  • Re: Web Application, converted from WebSite, fails to startup

    06-27-2008, 4:38 AM
    Answer

    Hi,

    When we use "Convert to Web Application" to migrate the WebSite to Web Application, Visual Studio will rename the App_Code folder to Old_App_Code.

    You need to make sure the Namespace of the class in the Old_App_Code folder matches that you used in another place, such as code behind.

    With VS 2005 Web Site Projects, ASP.NET automatically adds a strongly typed "Profile" object to each page. But VS 2005 Web Application Projects don't support this. To resolve this issue, you can create your own "ProfileCommon" class with the profile configuration.

    For more information, see http://webproject.scottgu.com/CSharp/Migration2/Migration2.aspx (Section:  Migrating Code that works with the ASP.NET 2.0 Profile Object).

     

    I hope this helps.

     

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Page 1 of 1 (2 items)
Microsoft Communities
Page view counter