0

I'm having a lot of trouble getting our solution working in VS 2015 using the latest version of Glass.

As suggested previously I have checked all projects and they now all have consistent DLL version references. System.Web.Mvc is version 5.2.3.0 Target framework is version 4.5.2 in all projects and in web.config

I've completed removed all existing Glass references and then used NuGet to add Glass.Mapper.Sc latest version 4.3.4.196.

I have got rid of all my other problems and build warnings, but I do still get this:

Warning     Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. Domain  C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets 1820

Checking the output log I see the warnings are caused by Glass.Mapper.Sc.Mvc.dll. When I check the build output I can see that Glass.Mapper.Sc.Mvc.dll references Sitecore.Mvc, Version=1.0.0.0 and Sitecore.Kernel, Version=8.1.0.0. There doesn't appear to be anything I can do to fix this as there isn't a version that references Sitecore.Mvc, Version=1.1.0.0 and Sitecore.Kernel, Version=10.0.0.0

Could this be causing issues or should I ignore these warnings?

The issue I am facing in my cshtml files is an Intellisense error whenever I use GlassView methods such as Editable:

Error   CS0012  The type 'Expression<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Yes, I have added a reference to System.Core but it doesn't help. My solution still works when I build and deploy to IIS!

  • Can you confirm that the projects you are adding Glass Mapper to have a reference to Sitecore.Kernel and Sitecore.Mvc before you added the Nuget package to them? – jammykam Jan 25 '17 at 19:25
1

I would recommend turning on diagnostics in the build log to get more details.

In Visual Studio 2015, turn on diagnostics of your MSBuild.

Go to Tools >> Options >> Project and Solutions >> Build and Run >> MSBuild project build output verbosity

This will give you details on the build and you can see what Visual Studio thinks there is a conflict.

Most likely, you will need to uninstall the Glass NuGet package and any other NuGet packages that are affected, clean your solution, and delete the appropriate packages under the packages folder of your solution.

Also search in the output of the build for the word "chosen" (I believe), this will tell you the paths of versions of Glass that were found.

  • Thanks for the advice. We did try this already and this is how I tracked down and removed the DLL conflict build warnings from the solution. But we couldn't find a solution to this intellisense issue in the build diagnostics. – DaveBeta Jan 26 '17 at 11:33
0

We managed to resolve this issue by adding another reference to our project! It was a trial and error process of adding DLL files from a clean Sitecore installation into our VS project's bin folder until the Intellisense issue was resolved.

Once we added this DLL System.Web.Http.Cors.dll taken from a clean Sitecore installation suddenly everything works great. So the fix it to reference that exact DLL:

<Reference Include="System.Web.Http.Cors, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\References\System.Web.Http.Cors.dll</HintPath>
</Reference>

This caught us by surprise because we had upgraded from VS 2013 to VS 2015 and we had no problems with this issue until we upgraded VS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.