Microsoft Developer Network > 포럼 홈 > Visual C# IDE > Could not load type '_Default'
질문하기질문하기
 

질문Could not load type '_Default'

  • 2007년 1월 17일 수요일 오후 2:28Chris Via 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    I've looked at countless blogs and forums and have tried everything and I still get the error: Could not load type '_Default'.

    I created an ASP.NET web site, using C# and when I go to the Default.aspx page in the browser I get the error. So far I have removed my lib environment variables from Windows System panel, checked with the VS2005 Cmd Prompt to make sure it's set correctly there, I build the web site, I have my Web.config file telling it debug=true, and so on. No matter what I do, after it builds and I copy the files to the web server and navigate to the page, I get the Could not load type '_Default' error.

    The only way I've been able to get around this is to use Inline Coding and I desperately want to get away from that!!!

    Any help is greatly appreciated.

    - Chris

모든 응답

  • 2007년 1월 17일 수요일 오후 6:25TaylorMichaelLMVP, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    The LIB stuff is only for C++. 

    It sounds like you are not copying all the necessary files to your web server.  Under the default v2 model for a web site you will copy all the files including the cs files to the web server.  The cs files will get compiled on the fly as needed by ASP.NET.  You can change the default settings through the project settings.  If you pre-compile your site then you'll need to be sure to copy the Bin\ directory and its files to the web server.

    Michael Taylor - 1/17/07
    http://p3net.mvps.org

     

  • 2007년 1월 17일 수요일 오후 6:37Chris Via 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    Thanks for your reply. I think I've got it working now. I had to use the following asp compiler command:

    aspnet_compiler -p "D:\BuildManagerApp" -f -v -u "D:\Inetpub\wwwroot\BuildManager"

    Then, it works. I don't have to move any files (including bin) or any of that. It seems to compile a DLL and then marker files for my code and place that in the IIS directory.

  • 2007년 1월 21일 일요일 오후 10:48frederikm 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    Hi

    just a quick question,

    did you create your virtual directory by hand in iis or did you create it from within visual studio?

    I had a similar problem where the error i got was that asp.net could not find/create the global.asax type

    removing the virtual directory from iis and recreating if from within visual studio solved the issue

     

    Kind regards

     

  • 2008년 7월 15일 화요일 오전 8:06YouCanDoIt 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    In the setup project you create for your application, you must specify that the Primary output from the Project goes into the "bin" folder (click on the "primary output" and browse to "bin" in the Folder property) , otherwise IIS can't find it. Once the dll is in the bin folder, IIS finds it and loads it.