locked
Legacy app-3.5- Could not load type RRS feed

  • Question

  • User2048898515 posted

    Hi Team,

    In our we company we have a legacy website which is in Dotnet 3.5. I opened this as a website in Visual Web Developer 2008.

    When i opened the website, it is not building. I am getting the error .

    Could not load type 'MachineTranslation.UI.Survey'.          F:\Nambi-GlobalEnglish\Bitbucket\MachineTranslation\dotnet\MachineTranslation\UI\Survey.aspx 1   .

    When i checked there were three files Survey.aspx, Survery.aspx.cs, Survery.aspx.designer.cs .

    But the file Survery.aspx.designer.cs which was supposed to be under "Survey.aspx" is coming separately. I dont know why.

    I believe that is the cause for the error "Could not load type"

    Check the attached screenshot.

    https://ibb.co/cSJRpe

    Monday, September 3, 2018 4:49 PM

All replies

  • User409696431 posted

    Try backing the designer.cs file up (just in case), then delete it from your solution and regenerate it using one of the methods in the following post: https://stackoverflow.com/questions/20858121/how-to-generate-aspx-designer-cs-in-visual-studio 

    Monday, September 3, 2018 5:49 PM
  • User-893317190 posted

    Hi nambir ,

    Do you open an aspx page of a project in a website? If so , you need to know aspx page in a project is different from  aspx page in a website.

    In website , aspx page has no .designer.cs file. Perhaps this is why you have a separated designer.cs file.

    To solve your problem , just change your aspx page's CodeBehind property to CodeFile  as follows.

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

    Best regards,

    Ackerly Xu

    Tuesday, September 4, 2018 8:21 AM
  • User409696431 posted

    Ackerly Xu,

    Good catch on the "opened <g class="gr_ gr_850 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" id="850" data-gr-id="850">as</g> <g class="gr_ gr_851 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" id="851" data-gr-id="851">website</g>".  If it has designer files, it is not a website, but an application and needs to be opened as a Project/Solution.

    You could convert it to a website by changing the CodeBehind to CodeFile, which would make it a compile-on-demand site rather than a pre-compiled application.

    If this is the case, all your .aspx pages will show the same problem.

    Wednesday, September 5, 2018 2:38 AM