The given assembly name or codebase was invalid
Today we created a new project in Visual Studio .NET 2003, when we tried to run a webservice, we got this cryptic error message:
Server Error in 'TheProjectNameHasBeenRemoved' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
Parser Error Message: The given assembly name or codebase,
'ThisNameHasBeenRemoved', was invalid.
Source Error:
Line 263: <add assembly="System.EnterpriseServices,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 264: <add assembly="System.Web.Mobile,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 265: <add assembly="*">
Line 266: </assemblies>
Line 267:
Source File:
c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config Line:
265
Assembly Load Trace: The following information can be helpful to determine
why the assembly 'ThisNameHasBeenRemoved' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = ThisNameHasBeenRemoved
(Partial)
LOG: Appbase =
file:///c:/inetpub/wwwroot/TheProjectNameHasBeenRemoved/ThisNameHasBeenRemoved
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: ThisNameHasBeenRemoved
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/ThisProjectNameHasBeenRemoved/5a38ff29/c803bfd4/ThisNameHasBeenRemoved.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/ThisProjectNameHasBeenRemoved/5a38ff29/c803bfd4/ThisProjectNameHasBeenRemoved/ThisNameHasBeenRemoved.DLL.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/ThisProjectNameHasBeenRemoved/bin/ThisNameHasBeenRemoved.DLL.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: ThisNameHasBeenRemoved,
Version=1.0.2057.22204, Culture=neutral, PublicKeyToken=null
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
What was causing this error?
If you run as ASP.NET website or webservice, files are copied to the Temporary ASP.NET Files folder.
The full path looks like this:
C:\Windows\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\<Virtual Application Folder>\6ca4fcfa\e8f0a674\assembly\dl2\e377cdc3\f1962fd2_31a3c501\<Assembly Name>.DLL
We had chosen a very descriptive name for our assembly causing the length of the total path mentioned above to exceed the 256 character limit... So the assembly could not be copied to the temporary folder. It's amazing this limit still counts for modern applications...
In Visual Studio .NET 2005 there are checks on the length, you'll even get a decent message if a path is too long! (At least in Beta 2)
Server Error in 'TheProjectNameHasBeenRemoved' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
Parser Error Message: The given assembly name or codebase,
'ThisNameHasBeenRemoved', was invalid.
Source Error:
Line 263: <add assembly="System.EnterpriseServices,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 264: <add assembly="System.Web.Mobile,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 265: <add assembly="*">
Line 266: </assemblies>
Line 267:
Source File:
c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config Line:
265
Assembly Load Trace: The following information can be helpful to determine
why the assembly 'ThisNameHasBeenRemoved' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = ThisNameHasBeenRemoved
(Partial)
LOG: Appbase =
file:///c:/inetpub/wwwroot/TheProjectNameHasBeenRemoved/ThisNameHasBeenRemoved
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: ThisNameHasBeenRemoved
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/ThisProjectNameHasBeenRemoved/5a38ff29/c803bfd4/ThisNameHasBeenRemoved.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/ThisProjectNameHasBeenRemoved/5a38ff29/c803bfd4/ThisProjectNameHasBeenRemoved/ThisNameHasBeenRemoved.DLL.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/ThisProjectNameHasBeenRemoved/bin/ThisNameHasBeenRemoved.DLL.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: ThisNameHasBeenRemoved,
Version=1.0.2057.22204, Culture=neutral, PublicKeyToken=null
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
What was causing this error?
If you run as ASP.NET website or webservice, files are copied to the Temporary ASP.NET Files folder.
The full path looks like this:
C:\Windows\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\<Virtual Application Folder>\6ca4fcfa\e8f0a674\assembly\dl2\e377cdc3\f1962fd2_31a3c501\<Assembly Name>.DLL
We had chosen a very descriptive name for our assembly causing the length of the total path mentioned above to exceed the 256 character limit... So the assembly could not be copied to the temporary folder. It's amazing this limit still counts for modern applications...
In Visual Studio .NET 2005 there are checks on the length, you'll even get a decent message if a path is too long! (At least in Beta 2)
0 Comments:
Post a Comment
<< Home