TFS Build Failing on System.Windows - tfs

I've been trying to run my build on TFS and I keep getting an error that kills my build. What's strange is that nothing except code change has been done since the issue started (Or at least that I'm aware about). I keep seeing this:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.WinFx.targets (268): Unknown build error, 'Cannot resolve dependency to assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.'
I've googled this and the only thing I see is that it's because there's a Silverlight dll being used in a WPF application. My application is a WPF project, but I haven't been able to find any changes being done in any of my projects in my solution in regards to references.
For more information, this project is a branch from the main code. The main development branch runs fine, but for some reason, this build just fails.
Any ideas?

It seems like you're referencing the Silverlight version of System.Windows instead of the .NET Framework version. Have you tried installing Silverlight on the build server or changing the reference of your project to point to the normal .NET Framework version of that assembly (which .NET Framework exists on your build server)?

Related

MvcSiteMapProvider.dll not working in Visual Studio 2013

I have a MVC 2 project created in Visual Studio 2010 that use MvcSiteMapProvider.dll and works fine. But when loading the project in Visual Studio 2013, everything else work fine except it crashes at
Html.MvcSiteMap().SiteMapPath
The error message is
An exception of type 'MvcSiteMapProvider.MvcSiteMapException' occurred in MvcSiteMapProvider.dll but was not handled in user code
I believe that MvcSiteMapProvider.dll cannot be loaded correctly. I need help on this. Thanks.
Note that there is a separate DLL for each .NET framework version, and I suspect you are targeting the wrong framework. This can happen if you install MvcSiteMapProvider into your project and then change it to a different .NET framework version.
NuGet does not automatically upgrade/downgrade packages to the currently set framework version. This step must be done manually. The best way is to completely uninstall and reinstall the package as per this document. Also be sure to read this before attempting it.
But do note that if you do this NuGet will not remove any files you have changed (like Mvc.sitemap) and then prompt you whether to overwrite them. You should normally say no to each prompt to ensure your custom configuration is not overwritten.
Also note that it is not sufficient to use Assembly Binding Redirection with MvcSiteMapProvider because with each .NET framework version we create a separate build (DLL) that takes advantage of features that are not present in prior versions.

BCL.Async issue with F# project

Using the latest VS2013, if I create a clean console application and add a nuget reference to BCL.Async, all colouration in VS dies. You then get: -
"Internal language services have encountered severe errors. Syntax coloring or other features may stop working. If you experience such issues, they could be fixed as follows: (1) Clean current solution (2) Restart Visual Studio (.."
Needless to say neither works.
The bug is repro-ed when the project targets .NET 4.0 but not when it targets .NET 4.5.
To be clear, the error message originates from Visual F# Power Tools (see https://github.com/fsprojects/VisualFSharpPowerTools/blob/bc76dc272cb941fdbc04e2a0d203a685c5d3bc84/src/FSharpVSPowerTools.Logic/Resource.fs#L55). What happened is that FSharp.Compiler.Service chokes on newly-added assemblies and throws exceptions to upper layers.
When I installed Microsoft.BCL.Async from NuGet package console, there are some installation errors. So I had to manually add references to System.Data, System.ServiceModel and System.ServiceModel.Discovery so that the project can be compiled. When the project is compilable, colorization goes back in normal.
That said, the error message could be improved to avoid being so horrifying though.

file load exception prblem in mvc project

I am trying to run a project on my system (the project is in mvc and azure ).
i am able to build the project but it is showing error on run time .the error message is as following :-
Could not load file or assembly 'System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Check the .net version in your IIS app pool. Also check the target version in your project properties and make sure you are targeting the same version your IIS app pool is configured for. You should be targeting 4.0+.
The likely problem is the target machine doesn't have the target assemblies installed.
You should make sure you have .NET framework v4 installed.
This shouldn't be happening on the same machine which the solution was built, as the assemblies are required during the build process.
This is a common-case that, I don't know who downvoted this question, but just because you don't know what this guy is talking about doesn't mean the question is invalid, of poor quality, etc. fact is this is enough information to solve the problem, barring any crazy, environment-specific problems created by the user.
Hope this helps others out there!

Problems Running Monodroid application with Db4o

My monodroid application builds fine and deploys to the device; however the application dies on start up and the DDMS shows the following error:
01-07 17:04:57.607: E/mono(875): Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Db4objects.Db4o, Version=8.0.224.15975, Culture=neutral, PublicKeyToken=6199cd4f203aa8eb' or one of its dependencies.
I have confirmed I am referencing DB4O and it shows up in the bin/debug directory.
Given this error I would think that db4o does not work with Monodroid but I have another Monodroid project which uses db4o and it works.
I have a feeling something is broken with the project file but not sure what to do. I have tried removing and adding the db4o reference a couple of times.
I am using Visual Studio 2010 and the latest version of Mondodroid as of 1/7/2012. I am deploying to a an Android 3.2 emulator.
Thanks in advance for any insight.
It sounds like you're running into a bug in the current version of Mono for Android that has to do with Fast Deployment. In the project's properties, under the Mono Android Options section, uncheck the box for Use Fast Deployment. You'll probably need to do a clean build as well to make sure it takes effect.

Web Deploy does not include files necessary for NHibernate in deployment

I am building my deployment process and I am running into a really annoying problem.
Using Visual Studio 2010 Sp1 on a .Net4 project with ASP.NET MVC3 that I want to deploy to an IIS7.5 webserver. The deployment works fine - both from Visual Studio and command line - except for this one important part:
I am using NHibernate (with Fluent NH) in a class library that is referenced by my web app. These were installed using NuGet, and also show up on the server when deployed.
However, these depend on some other libraries:
Castle.Core
Iesi.Collections
NHibernate.ByteCode.Castle
These are also fetched by NuGet, they are referenced in my class library, and the references have "Copy Local" set to True. However, out of these three, only Iesi.Collections actually show up on the server!
Of course, I can copy them manually, but the next time I run the deploy, it will delete them. Deleting unused files is actually something I want, but these files should not be in that category!
What can I do to make Web Deploy respect the fact that these guys are desired members of my application!?
Try adding those assemblies as references to your web project otherwise implicit references in class libraries might not be included.

Resources