Results 1 to 26 of 26

Thread: The given assembly name or codebase was invalid.

  1. #1

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    The given assembly name or codebase was invalid.

    Hello everybody,

    When I deployed my VS 2005 website on Win 2008 server, it says "System.IO.FileLoadException: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)"

    Any workaround?

    Thanks.

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: The given assembly name or codebase was invalid.

    Hey,

    Do you know at which point in the code this exception is thrown?

    Can you show the code that is causing the problem?

    Is the correct version of the .Net Framework installed on the server that you are deploying?

    Gary

  3. #3

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: The given assembly name or codebase was invalid.

    I'm not sure on which point its throwing the exception. It just blows up when I try to access the website with browser. The default page is a simple login page and has nothing in the Page_Load event unless only session reset code. Here's the page load event.

    Code:
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
            If Page.IsPostBack = False Then
                If Session.Count > 0 Then
                    Session.RemoveAll()
    
                End If
                'btnReset.Attributes.Add("onClick", "ResetControl();"); 
    
            End If
            lblError.Text = ""
    
        End Sub
    I checked .Net Framework 2.0 is installed and set in the application pool of the virtual directory.

    Thanks.

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: The given assembly name or codebase was invalid.

    Hey,

    Can you show the aspx for the page?

    Have you had to register any dll's, either in the aspx or in the web.config file. If so, what are they, and do they exist on the server you are deploying to?

    Gary

  5. #5

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: The given assembly name or codebase was invalid.

    I have attached the master file and default here. I don't have any dlls other than those that were created when I compiled the project. I have used crystal reports in my project and I have installed crystal report merge modules on the server. Prior to installing the CR merge modules, it was giving CR reference errors but when I installed the merge module, CR errors went away and this error started showing up.

    Thanks a lot.
    Attached Files Attached Files

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: The given assembly name or codebase was invalid.

    Do you know for sure that .NET 2.0 is in the Win2K8 server? Any hotfixes or service packs on your machine that wouldn't be on the server?

  7. #7

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: The given assembly name or codebase was invalid.

    I am sure and I have double checked that ASP.NET 2.0 is installed since other 2.0 websites are running on the same box. I have checked that 2.0 is selected in the app pool my website is using.

    When I published the website, this is how the page directive is changed.

    <%@ page autoeventwireup="true" inherits="_Default, App_Web_jxt3h6vr" language="VB" %>

    Is it ok?

    Thanks.

  8. #8
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: The given assembly name or codebase was invalid.

    Hey,

    Are you changing the Page Directive? You shouldn't need to do that?!?!

    Gary

  9. #9

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: The given assembly name or codebase was invalid.

    I didn't change it. It was changed when I published my website using VS.

    Thanks.

  10. #10

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: The given assembly name or codebase was invalid.

    When I tested the settings in IIS, it couldn't pass the Authorization test. I have attached the snapshot. Can this be a problem?

    Thanks.
    Attached Images Attached Images  

  11. #11
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: The given assembly name or codebase was invalid.

    What are the details on the Authorization entry?

    Gary

  12. #12

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: The given assembly name or codebase was invalid.

    Here it is.
    Attached Images Attached Images  

  13. #13
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: The given assembly name or codebase was invalid.

    So, have you tried what it is suggesting?

  14. #14
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: The given assembly name or codebase was invalid.

    Have a look at the app pool identity in IIS. Find your app's app pool, right click, advanced settings, identity, ..., dialog box.
    Attached Images Attached Images  

  15. #15
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: The given assembly name or codebase was invalid.

    Oooo, that must be the shiny new IIS!!

    I haven't played with that yet. Is it any good? (Sorry to hijack your thread usamaalam)

    Gary

  16. #16
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: The given assembly name or codebase was invalid.

    Oh my yes, I think it's faster, more responsive, it has gradients and very configurable. The only time I've had problems with it is when hosting a net.tcp WCF Service in it - I had to go commandline for that. They should have that fixed in IIS 7.2 I think. Did I mention the gradients?

  17. #17
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: The given assembly name or codebase was invalid.

    Gradients, wow!!

    I am running Windows 7 now, which I assume has IIS7, will have to get it installed and have a play.

    Gary

  18. #18

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: The given assembly name or codebase was invalid.

    mendhak,

    I have Network Service selected in the app pool identity, should I change it? I am still unable to figure out how to solve the authorization problem I discussed above. Any word on how to fix it?

    gep13,

    No problem, I thank you as you were getting in touch to solve my problem.

    Thanks.

  19. #19
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: The given assembly name or codebase was invalid.

    Go to C:\webapps\vipcard, right click, properties, security, add NETWORK SERVICE and give it full permissions on that folder. Or, change that dropdown to Local System. The latter is not recommended.

  20. #20

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: The given assembly name or codebase was invalid.

    I already have this permission.
    Attached Images Attached Images  

  21. #21
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: The given assembly name or codebase was invalid.

    Tougher and tougher

    Alright, go back and change the identity from Network Service to Local System. What happens then?

    Also, I don't know if I've asked this - do other ASP.NET apps work on the same server?

  22. #22

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: The given assembly name or codebase was invalid.

    I changed it to Local System but still no luck . Here's the url of the site.

    http://vipdemo.pcsn.net/

    Below is an ASP.NET 2.0 application deployed on the same box.

    http://comp.pcsn.net/

    Thanks.

  23. #23
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: The given assembly name or codebase was invalid.

    How are you deploying? Publish+copy or straight copy? If you're doing one, try the other.

  24. #24
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: The given assembly name or codebase was invalid.

    Actually, that might be it. It's a problem with your publish process. I'm betting that the other site, which works, is not deployed using publish or that it is a web application project. Am I partially right?

  25. #25

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: The given assembly name or codebase was invalid.

    I published the website. I'll copy it straight and will let you know what happens.

    Thanks.

  26. #26
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: The given assembly name or codebase was invalid.

    *Drums fingers impatiently*

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width