Binary Booyah!

Just another pile of random junk.

ASP.NET error: Could not load file or assemply App_Web

clock September 6, 2007 07:44 by author Jordan

Just another one of those ASP.NET errors that seems to pop up for no reason at all. 

Could not load file or assembly 'App_Web_xxxxxxxx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Cause: Something has corrupted the version of the app stored in the .NET temp folder. This seems to occur occasionally when you edit a nested custom control.

QuickFix: Change a setting in the web.config to force the app to recompile. This should get you rolling again, but the problem will happen again eventually.

Unconfirmed fixes: (I'll test more of these if the error pops up again)

1-Configure virus scan software to ignore the app and .NET temp folders. This may help prevent it from happening again.

2-Disable the indexing service. This may help prevent it from happening again.

3-Set "<compilation batch=false" in the web.config file. (My guess is this has no lasting effect over the quickfix above)

4-Clean out the .NET temp directory. 



.NET error: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints

clock September 5, 2007 11:32 by author Jordan

If you like using .NET TableAdapters then I'd bet you've seen this message more than once:

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

This message is (like always) not very helpful in tracking down the problem, but going through the list below should help track down the cause.

Causes:

  • Field size has changed.
  • Bad query.
  • .NET doesnt like you.

Fixes:

  • Field size has changed. This has been the cause a couple of times for me. I'm not the only one modifying the database, so things can change without notice occasionally. Check to make sure the MaxLength property for each field is set correctly in the TableAdapter. If a value is pulled from the database that is too long it can throw the error.
    Note: this can also occur without any changes to the database if your TableAdapter references a Stored Procedure. Stored Procedures do not always communicate the correct MaxLength of fields when building the TableAdapter, so always ensure the MaxLength of each field is correct when using Stored Procedures.
  • Bad query. Run the query in Query Analyser and check to make sure you are not pulling duplicate keys or null values in fields that should not be null.
  • .NET doesnt like you. If all else fails delete the TableAdapter and recreate it. This can be very annoying, but sometimes it is easier than checking each field individually.


Search

Categories


Tags

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Sign in