Visual Studio 2010 UnresolvedAssemblyException: Universe type cannot allow assembly: log4net

I recently started to encounter exceptions in the WPF designer of Visual Studio 2010, it seems because of log4net. If I just create my project, the XAML file will correctly display in the designer. Then, as soon as I start clicking on the controls to go into XAML, this exception is thrown quickly:

System.Reflection.Adds.UnresolvedAssemblyException

Type universe cannot resolve assembly: log4net, Version=1.2.10.0, Culture=neutral,    PublicKeyToken=1b44e1d426115821.

at System.Reflection.Adds.AssemblyProxy.GetResolvedAssembly()
at System.Reflection.Adds.AssemblyProxy.GetHashCode()
continues...

The problem is removed only when the log4net link is removed. This is the second project to demonstrate this behavior. Has anyone else seen this and / or found a fix?

Note. I am using .NET 4 Full (not a client profile) and I switched the specific version to the log4net T / F link to no avail.

+5
5

:

  • , , Public Assemblies ( k3b fuslogvw)

  • FileLoadException, SO.

  • log4net, zip VS Public Assemblies.

, Public Assemblies. , , .

+3

"Assembly Loging Log Viewer" (Fuslogvw.exe), dotnet sdk, , DLL , . , , .

. http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.80).aspx

dll , .

project.dll, log4net.dll = true

+1

, , , .

".targets", . , .targets , .

, HintPath - ...

<HintPath>C:\Program Files (x86)\\Custom\CustomControlsWPF2.2011\Source\\..\Binaries\WPF\Custom.Windows.Controls.dll</HintPath>

, "\", " Visual Studio 2010 UnresolvedAssemblyException: " .

.

<HintPath>C:\Program Files (x86)\Custom\CustomControlsWPF2.2011\Source\..\Binaries\WPF\Custom.Windows.Controls.dll</HintPath>
+1

Make sure your code runs at design time as well as runtime. If your code works during development, do not assume that Application.Current is your application. For example, when you use Expression Blend, Current is Expression Blend. Typical operations that cause a user control to fail during development include the following.

-Casting Current to your custom subclass of Application.

-Using the FindName method on Current.

-Not checking whether Application.Current has returned a value that is null. If Visual Studio does not create an application object, then Application.Current may return null.

http://msdn.microsoft.com/en-us/library/ff356886%28v=vs.95%29.aspx

try this. add it to the top of your functions:

// Check for design mode. 
if ((bool)(System.ComponentModel.DesignerProperties.IsInDesignModeProperty.GetMetadata(typeof(DependencyObject)).DefaultValue))
{
    return;
}
0
source

All Articles