Can't write log entry with Google Cloud's Log4net integration - stackdriver

I'm trying to get the Log4Net integration working in a .NET Core app that will be deployed to the AppEngine Flexible environment. My starting point is the sample code in the documentation. My code looks as such:
using log4net; // resolve Log4net
using log4net.Config; // resolve XmlConfigurator
using System.IO; // resolve FileInfo
using System.Reflection; // resolve Assembly
namespace Test
{
public class PlayWithStackdriverLog4net
{
public void Write()
{
log4net.Util.LogLog.InternalDebugging = true; // enable Log4net debugging
var xmlConfiguration = XmlConfigurator.Configure(LogManager.GetRepository(typeof(PlayWithStackdriverLog4net).Assembly), new FileInfo("log4net.xml"));
ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
log.Info("An exciting log entry!");
}
}
}
Unfortunately, the end result is that I don't see An exciting log entry! in my Google Cloud Console's Logging pane. What am I doing wrong?
Some remarks:
1) The file, log4net.xml, is pretty much the one in the documentation, except that I've replaced PROJECT-ID with my own ID.
2) The Log4net debug output suggests that it has succesfully read from log4net.xml:
log4net: log4net assembly [log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a]. (.NET Framework [.NET Core 4.6.26020.03] on Microsoft Windows 6.1.7601 S)
log4net: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository for assembly [Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
log4net: Assembly [Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] Loaded From [Not supported on .NET Core]
log4net: Assembly [Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified.
log4net: Assembly [Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
log4net: Creating repository [log4net-default-repository] using type [log4net.Repository.Hierarchy.Hierarchy]
log4net: configuring repository [log4net-default-repository] using file [log4net.xml]
log4net: configuring repository [log4net-default-repository] using stream
log4net: loading XML configuration
log4net: Configuring Repository [log4net-default-repository]
log4net: Configuration update mode [Merge].
log4net: Logger [root] Level string is [ALL].
log4net: Logger [root] level set to [name="ALL",value=-2147483648].
log4net: Loading Appender [CloudLogger] type: [Google.Cloud.Logging.Log4Net.GoogleStackdriverAppender,Google.Cloud.Logging.Log4Net]
log4net: Converter [message] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [newline] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Setting Property [ConversionPattern] to String value [%-4timestamp [%thread] %-5level %logger %ndc - %message]
log4net: Converter [timestamp] Option [] Format [min=4,max=2147483647,leftAlign=True]
log4net: Converter [literal] Option [ [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [thread] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [literal] Option [] ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [level] Option [] Format [min=5,max=2147483647,leftAlign=True]
log4net: Converter [literal] Option [ ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [logger] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [literal] Option [ ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [ndc] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [literal] Option [ - ] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Converter [message] Option [] Format [min=-1,max=2147483647,leftAlign=False]
log4net: Setting Property [Layout] to object [log4net.Layout.PatternLayout]
log4net: Setting Property [ProjectId] to String value [my-project-id-goes-here]
log4net: Setting Property [LogId] to String value [mySampleLog]
log4net: Created Appender [CloudLogger]
log4net: Adding appender named [CloudLogger] to logger [root].
log4net: Hierarchy Threshold []
3) If I follow the example for Stackdriver Logging Client Libraries which uses Google.Cloud.Logging.V2 instead then I can find my 'hello world' text in the global resource type as expected.

As requested by dsesto I am closing this question as it has been confirmed as a bug, see comment.

Related

Could not load file or assembly xxx or one of its dependencies. An attempt was made to load a program with an incorrect format

I have checked all similar questions but no solution worked for me:
I have my web application build properties set to: Any CPU for all configurations. (I have also tried all combinations) - that is what mostly solved the problem in similar questions.
Also in app pool I have 32 bit application set to TRUE.
I run my web site on IIS 7.5
My web application is build without and error, but when i run it i get the following error from log:
*** Assembly Binder Log Entry (23.3.2016 # 9:51:19) ***
The operation failed.
Bind result: hr = 0x8007000b. An attempt was made to load a program with an incorrect format.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\WINDOWS\SysWOW64\inetsrv\w3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = SM.EORD.Web
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: SM.EORD.Web | Domain ID: 3
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///D:/Documents/Projekti/TFSProd/eOrdering/Main/Source/SM.EORD/SM.EORD.Web/
LOG: Initial PrivatePath = D:\Documents\Projekti\TFSProd\eOrdering\Main\Source\SM.EORD\SM.EORD.Web\bin
LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\eorddev\883938bb
LOG: Cache Base = C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\eorddev\883938bb
LOG: AppName = ad349442
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Documents\Projekti\TFSProd\eOrdering\Main\Source\SM.EORD\SM.EORD.Web\web.conf ig
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/eorddev/883938bb/ad349442/SM.EORD.Web.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/eorddev/883938bb/ad349442/SM.EORD.Web/SM.EORD.Web.DLL.
LOG: Attempting download of new URL file:///D:/Documents/Projekti/TFSProd/eOrdering/Main/Source/SM.EORD/SM.EORD.Web/bin/SM.EORD.Web.DLL.
LOG: Assembly download was successful. Attempting setup of file: D:\Documents\Projekti\TFSProd\eOrdering\Main\Source\SM.EORD\SM.EORD.Web\bin\SM.EORD.Web.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: SM.EORD.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
ERR: Invalid assembly platform or ContentType in file (hr = 0x8007000b).
ERR: Setup failed with hr = 0x8007000b.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
*** Assembly Binder Log Entry (23.3.2016 # 9:51:19) ***
The operation failed.
Bind result: hr = 0x8007000b. An attempt was made to load a program with an incorrect format.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\WINDOWS\SysWOW64\inetsrv\w3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = SM.EORD.Web
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: SM.EORD.Web | Domain ID: 3
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///D:/Documents/Projekti/TFSProd/eOrdering/Main/Source/SM.EORD/SM.EORD.Web/
LOG: Initial PrivatePath = D:\Documents\Projekti\TFSProd\eOrdering\Main\Source\SM.EORD\SM.EORD.Web\bin
LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\eorddev\883938bb
LOG: Cache Base = C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\eorddev\883938bb
LOG: AppName = ad349442
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Documents\Projekti\TFSProd\eOrdering\Main\Source\SM.EORD\SM.EORD.Web\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/eorddev/883938bb/ad349442/SM.EORD.Web.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/eorddev/883938bb/ad349442/SM.EORD.Web/SM.EORD.Web.DLL.
LOG: Attempting download of new URL file:///D:/Documents/Projekti/TFSProd/eOrdering/Main/Source/SM.EORD/SM.EORD.Web/bin/SM.EORD.Web.DLL.
LOG: Assembly download was successful. Attempting setup of file: D:\Documents\Projekti\TFSProd\eOrdering\Main\Source\SM.EORD\SM.EORD.Web\bin\SM.EORD.Web.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: SM.EORD.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
ERR: Invalid assembly platform or ContentType in file (hr = 0x8007000b).
ERR: Setup failed with hr = 0x8007000b.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
Any idea?
br, Simon

Newtonsoft.Json.dll issue when using multiple projects

I am seeing some really odd behavior that I have not been able to correct related to references for Newtonsoft.Json.dll. I have a sample solution set up with the following projects:
JsonProblem.Core
JsonProblem.CauseProblem (references JsonProblem.Core)
JsonProblem.Web (references JsonProblem.Core and JsonProblem.CauseProblem)
In JsonProblem.Core and JsonProblem.Web I have added the "Microsoft ASP.NET Web API 2.2" NuGet package. In JsonProblem.Core I have created a web api. If I build JsonProblem.Core and run a page from JsonProblem.Web everything works as expected.
Now if I build JsonProblem.CauseProblem and try to view a page in JsonProblem.Web, I get the following error.
Could not load file or assembly 'Newtonsoft.Json' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
If I rebuild JsonProblem.Core the error goes away. And again if I build JsonProblem.CauseProblem without building JsonProblem.Core afterward (even though JsonProblem.CauseProblem depends on JsonProblem.Core) I get the error. Somehow the build of JsonProblem.CauseProblem is causing version 4.5.11 of Newtonsoft.Json to get copied to the JsonProblem.Web bin directory, overwriting version 6.0.3. I'm pretty sure I have binding redirects setup correctly, as I have the following in the JsonProblem.Web web.config and in the app.config files for JsonProblem.Core and JsonProblem.CauseProblem:
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
So I am at a loss as to the cause of this strange behavior. I have reproduced it in 2 projects. It seems that the binding redirects are ignored when I build JsonProblem.CauseProblem. I can work around it, but I'm concerned that whatever bug or feature is causing this behavior may be altering other references in the background that might cause problems down the line.
EDIT - as tizzy suggested I used the fuslogvw tool. Here is what was generated in the log. I'm not sure how to interpret this, however, because the log does not tell me what happens at build time to overwrite the version of Newtonsoft.Json.dll in my the app's website directory.
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Program Files\IIS Express\iisexpress.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = Newtonsoft.Json
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Newtonsoft.Json | Domain ID: 5
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/John/Desktop/JsonProblem/JsonProblem.Web/
LOG: Initial PrivatePath = C:\Users\John\Desktop\JsonProblem\JsonProblem.Web\bin
LOG: Dynamic Base = C:\Users\John\AppData\Local\Temp\Temporary ASP.NET Files\vs\3661babd
LOG: Cache Base = C:\Users\John\AppData\Local\Temp\Temporary ASP.NET Files\vs\3661babd
LOG: AppName = 3b3fd45
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\John\Desktop\JsonProblem\JsonProblem.Web\web.config
LOG: Using host configuration file: C:\Users\John\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/John/AppData/Local/Temp/Temporary ASP.NET Files/vs/3661babd/3b3fd45/Newtonsoft.Json.DLL.
LOG: Attempting download of new URL file:///C:/Users/John/AppData/Local/Temp/Temporary ASP.NET Files/vs/3661babd/3b3fd45/Newtonsoft.Json/Newtonsoft.Json.DLL.
LOG: Attempting download of new URL file:///C:/Users/John/Desktop/JsonProblem/JsonProblem.Web/bin/Newtonsoft.Json.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Users\John\Desktop\JsonProblem\JsonProblem.Web\bin\Newtonsoft.Json.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.
LOG: Using application configuration file: C:\Users\John\Desktop\JsonProblem\JsonProblem.Web\web.config
LOG: Using host configuration file: C:\Users\John\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 4.5.0.0 redirected to 6.0.0.0.
LOG: Post-policy reference: Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
LOG: GAC Lookup was unsuccessful.
LOG: The post-policy assembly reference requires probing again.
LOG: Attempting download of new URL file:///C:/Users/John/AppData/Local/Temp/Temporary ASP.NET Files/vs/3661babd/3b3fd45/Newtonsoft.Json.DLL.
LOG: Attempting download of new URL file:///C:/Users/John/AppData/Local/Temp/Temporary ASP.NET Files/vs/3661babd/3b3fd45/Newtonsoft.Json/Newtonsoft.Json.DLL.
LOG: Attempting download of new URL file:///C:/Users/John/Desktop/JsonProblem/JsonProblem.Web/bin/Newtonsoft.Json.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Users\John\Desktop\JsonProblem\JsonProblem.Web\bin\Newtonsoft.Json.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
I had the exact same behavior as the above problem description, except that when I rebuilt my class library (i.e. JsonProblem.Core), it would pull in Newtonsoft.dll 4.5.11, even though this class library had no direct reference or Nuget package that indicated a reference to NewtonSoft.
In what could be considered a Visual Studio 2015 bug, the class library rebuild copies the invisibly referenced DLLs into referencing project bin folders (not currently being built), overwriting the DLLs in referencing projects, breaking them.
IOW, for example, build project Y (referencing JsonProblem.Core), apparent success. Build project X (ref to JsonProblem.Core) which breaks project Y. Build Project Y and now this breaks Project X. Infinite loop: while( sane ) { build(); }
In my case, the only 3rd party libraries that I was referencing in this library were Gibraltar.Agent and Gibraltar.Agent.Web.Mvc (which reported no dependency on NewtonSoft. Right clicking on these in project References and selecting "Find Code Dependent on this module" revealed that I didn't need to reference the 2nd one.
I uninstalled Gibraltar.Agent.Web.Mvc in Nuget, and all problems went away. Two days of DLL Hell heartache have ended.
You may be dealing with a handful of different scenarios here. My advice to you would be to use the fuslogvw tool to show you which dll it's trying to load, and where it's looking for it. It is possible that there is another dependency problem that is being masked here, since your assembly binding redirect looks correct on the surface. The fuslogvw tool will just allow you to see the assembly binding behavior, and what's happening. It's great to have for assembly binding issues.

Could not load file or assembly 'ServiceStack.OrmLite.SqliteNET' or one of its dependencies.

I've created Asp.Net MVC 4 application and using 'ServiceStack.OrmLite.Sqlite'. When I load the page I see the following error.
Could not load file or assembly 'ServiceStack.OrmLite.SqliteNET' or one of its dependencies. An attempt was made to load a program with an incorrect format
LOG: DisplayName = ServiceStack.OrmLite.SqliteNET
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: ServiceStack.OrmLite.SqliteNET | Domain ID: 36
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
I've used Visual studio 2012 Nuget installer to load the files. That means I've all the dependencies in place. I've set my project to 32bit and 64bit to troubleshoot the issue but in either case error is same.
Does ServiceStack.OrmLite.SqliteNET work on .Net 4.5 runtime?
I fixed the same issue on .Net 4.0. I don't believe it's a CLR version related issue. More of a Nuget dependency related one.
When I looked in the fusion log I found:
LOG: Post-policy reference: System.Data.SQLite, Version=1.0.84.0, Culture=neutral,
...
LOG: Assembly Name is: System.Data.SQLite, Version=1.0.85.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
It looks like the SQLite Nuget package was updated and that broke things.
To fix things:
I changed the reference in packages.config to version 1.0.84.0.
Did a restore of the Nuget packages
and manually rereferenced the two SQLite assemblies to the newly created version 84 folders in the solution level package cache.
Solution/issue reported on GitHub:
Solution is to manually remove System.Data.SQLite dependencies, remove references from package.config an than installing from nuget with '-Version 1.0.84.0'.

App_GlobalResources resources are not compiled into the bin/App_GlobalResources.dll

I am a newbie in ASP.NET. I am getting an error when deploying a web application with msbuild + msdeploy.
System.IO.FileNotFoundException: Could not load file or assembly 'App_GlobalResources' or one of its dependencies. The system cannot find the file specified.
=== Pre-bind state information ===
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = App_GlobalResources
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: App_GlobalResources | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/inetpub/wwwroot/MyServiceApp/
LOG: Initial PrivatePath = C:\inetpub\wwwroot\MyServiceApp\bin
Calling assembly : MyServiceApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\inetpub\wwwroot\MyServiceApp\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/MyServiceApp/b220778e/cc04677/App_GlobalResources.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/MyServiceApp/b220778e/cc04677/App_GlobalResources/App_GlobalResources.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyServiceApp/bin/App_GlobalResources.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyServiceApp/bin/App_GlobalResources/App_GlobalResources.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/MyServiceApp/b220778e/cc04677/App_GlobalResources.EXE.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/MyServiceApp/b220778e/cc04677/App_GlobalResources/App_GlobalResources.EXE.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyServiceApp/bin/App_GlobalResources.EXE.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyServiceApp/bin/App_GlobalResources/App_GlobalResources.EXE.
My msbuild tasks:
<Target Name="Build">
<MSBuild Projects="$(ProjectFilePath)"
Targets="Package"
Properties="OutDir=$(BuildDir)\;Configuration=$(Configuration);Platform=$(Platform);PackageLocation=$(WebPackageDir)\$(WebSiteName).zip"/>
</Target>
...
<Target Name="MsDeploy">
<Exec Command="$(WebPackageDir)\$(WebSiteName).deploy.cmd /Y /m:http://$(DeployServer)/MSDeployAgentService /U:$(DeployServerUser) /P:$(DeployServerPsw)"
ContinueOnError="false" />
</Target>
The bin directory contains en/MyServiceApp.resources.dll, de/MyServiceApp.resources.dll etc. Why the web server searches for the file App_GlobalResources.dll?
The MyServiceApp.App_GlobalResources.Xxx.xx.resources files appear in obj folder but App_GlobalResources are not compiled into the bin/App_GlobalResources.dll.
What is wrong?
I figured it out. The problem was the Eazfuscator. To fix the error I moved the resources from my business layer dll to a separate dll that is not obfuscated.

ASP.NET DLL Partial Binding Error

I am running into the following error when running my ASP.NET application. I am running this using IIS 6.0 on WinXP 64. The assembly is signed and thus needs a strong name, but apart from adding a reference and using the functions in the dll, I don't know how to resolve the error. I have tried installing the assembly in the GAC, but that did not help.
=== Pre-bind state information ===
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = random
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: random.dll | Domain ID: 10
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Root/Server/
LOG: Initial PrivatePath = C:\Root\Server\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Root\Server\web.config
LOG: Using host configuration file: \\?\C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/server/aeb22d03/3a6c0025/random.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/server/aeb22d03/3a6c0025/random/random.DLL.
LOG: Attempting download of new URL file:///C:/Root/Server/bin/random.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
The issue was resolved by enabling .NET v4.0 64 bit ISAPI extensions. The 32 bit extensions were enabled by default.

Resources