2

I have a solution with around 10 projects, I have not written any of this myself, but I'm going to take over a project here. The project that is the main project is based on WPF. When I try to run this project, I get the following compiler error:

The tag 'RoutingManagerView' does not exist in XML namespace 'clr-namespace:RoutingManager.Views;assembly=RoutingManager'. Line 29 Position 14. C:\Source\WSA\WsaClient\Views\MainView.xaml 29 14 WsaClient

Then, if I double click this error message, so that the xaml is opened, and the designer is loaded, the designer does not load, and I get 3 more error messages:

Unable to load the metadata for assembly 'WsaClient'. This assembly may have been downloaded from the web. See http://go.microsoft.com/fwlink/?LinkId=179545. The following error was encountered during load: Could not load file or assembly 'WsaClient' or one of its dependencies. The system cannot find the file specified. C:\Source\WSA\WsaClient\Views\MainView.xaml 1 1 WsaClient

Unable to load the metadata for assembly 'RoutingManager'. This assembly may have been downloaded from the web. See http://go.microsoft.com/fwlink/?LinkId=179545. The following error was encountered during load: Could not load file or assembly 'RoutingManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. C:\Steria\Forsvaret\P6088\Source\WSA\WsaClient\Views\MainView.xaml 1 1 WsaClient

The type 'Views:RoutingManagerView' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Source\WSA\WsaClient\Views\MainView.xaml 29 14 WsaClient

I googled it, and many have suggested that this is because a DLL is locked since it originates from the internet. However in my condition, I do not have a DLL. It's complaining on two projects that are a part of the solution, WsaManager and RoutingManager. I got all the source code on a zip file on an usb pen, and I have extracted it to somewhere on my c drive, so there is no remote access of the code.

If anyone have had the same or similar problem earlier, I would highly appreciate any pointers here on how to resolve this.

EDIT

The last error message is given on this line in the XAML file:

<Views:RoutingManagerView DataContext="{Binding Dependency}"/> 

And on the top of the XAML file, this is the import for the assembly:

xmlns:Views="clr-namespace:RoutingManager.Views;assembly=RoutingManager"
Øyvind Bråthen
  • 59,338
  • 27
  • 124
  • 151

6 Answers6

6

Resolve this by right clicking on the solution and choosing 'Rebuild Solution'

Nigel
  • 61
  • 1
  • 1
  • This was of course the first thing i tried, but it did not help in my case. Only a manual build of each single project from the one with least dependencies and up worked. – Øyvind Bråthen Dec 10 '12 at 14:14
3

An additional point for other readers: if your projects builds successfully, but you get this error message while trying to load your view in the designer, make sure your assembly is x86 or Any CPU, because Visual Studio 2010 is a 32bit process and cannot load x64 assemblies in the designer.

Francois Botha
  • 4,520
  • 1
  • 34
  • 46
  • Be careful when posting copy and paste boilerplate/verbatim answers to multiple questions, these tend to be flagged as "spammy" by the community. If you're doing this then it usually means the questions are duplicates so flag them as such instead: http://stackoverflow.com/a/12332340/419 – Kev Sep 08 '12 at 17:28
  • Thanks Franc, I found your comment useful indeed. I got a project which was to be converted to x64 and an x64 installer was to be created. I did that but then i was asked by the client to make some changed to the WPF UI portion of the project. I did try everything including "AllowLoadFromRemoteSources" Visual Studio Configuration to unblocking of assemblies but nothing seemed to help. Finally i saw your comment and when i changed back to x86 Configuration, Xaml loaded seamlessly! Microsoft seriously need to work on error messages what VS gives to developers! – Steve Johnson Feb 10 '13 at 08:53
2

Unable to load the metadata for assembly 'WsaClient'. This assembly may have been downloaded from the web. See http://go.microsoft.com/fwlink/?LinkId=179545. The following error was encountered during load: Could not load file or assembly 'WsaClient' or one of its dependencies. The system cannot find the file specified. C:\Source\WSA\WsaClient\Views\MainView.xaml 1 1 WsaClient

I run into same error: I can build and run my project, but I can not design XAML. I realized that it was local configuration issue because it's not replicable on my other machine (using same repository revision).

I started digging more and figured out that VS 2010 does not like # symbol in path. So error shows up when I have my sources in

C:\#projects\<my project>

After I moved them to

C:\projects\<my project>

Problem is gone.

I hope this will help to someone else.

Yannick Blondeau
  • 9,465
  • 8
  • 52
  • 74
Eugene Wechsler
  • 147
  • 1
  • 3
2

Try this, this was the only advice that worked for me:

Unable to load the metadata for assembly ''. This assembly may have been downloaded from the web. See http://go.microsoft.com/fwlink/?LinkId=179545.  The following error was encountered during load: Could not load file or assembly '' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

In WPF project to allow the project to load from remote source we have to enable it in the configuration file devenv.exe.config.

Step 1: Search the configuration file devenv.exe.config in your system. Usually it is located at

C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config

Step 2: Edit the configuration file. Add following line in the tag

<loadFromRemoteSources enabled="true" />

Step3: Restart your visual studio.

http://exacthelp.blogspot.cz/2012/02/unable-to-load-metadata-for-assembly.html

j0k
  • 22,600
  • 28
  • 79
  • 90
2

To resolve this problem, I had to compile the projects one by one, starting from the project with no dependencies on other projects, and then working my way "up".

It seems that the Build all did not manage to do this properly automatically.

Øyvind Bråthen
  • 59,338
  • 27
  • 124
  • 151
0

I suspect the ..

The tag 'RoutingManagerView' does not exist in XML namespace 'clr-namespace:RoutingManager.Views;assembly=RoutingManager'. Line 29 Position 14. C:\Source\WSA\WsaClient\Views\MainView.xaml 29 14 WsaClient

.. error is causing a cascade of other errors. It looks like you're trying to create a RoutingManagerView from the namespace RoutingManager.Views in the assembly RoutingManager. However, it is not there. Make sure the class is visible to the outside world. Or try to clean and rebuild the solution and see on which project the first error occurs. Because if the projects are interdependent, an error in one project might cause reference errors in others.

LueTm
  • 2,366
  • 21
  • 31
  • LueTm - All the required classes are there. It seems this was a compilation issue, and no problem with the code. See the answer I have added here for details. – Øyvind Bråthen May 02 '11 at 06:38