Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type MiniProfiler exists in both Miniprofiler.Shared and MiniProfiler

I am trying to use the stack exchange MiniProfiler in my asp MVC project, but getting a really annoying error message in my view, where I am calling

@using StackExchange.Profiling

and

@MiniProfiler.RenderIncludes()

on the RenderIncludes line, VS complains that

The type 'MiniProfiler' exists in both 'MiniProfiler.Shared, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b44f9351044011a3' and 'MiniProfiler, Version=3.2.0.157, Culture=neutral, PublicKeyToken=b44f9351044011a3'

I already checked the (.csprroj) project file, and it only contains one element referencing MiniProfiler:

<Reference Include="MiniProfiler, Version=3.2.0.157, Culture=neutral, PublicKeyToken=b44f9351044011a3, processorArchitecture=MSIL">
  <HintPath>..\packages\MiniProfiler.3.2.0.157\lib\net40\MiniProfiler.dll</HintPath>
</Reference>

I also checked in packages.config and it also only has 1 reference to MiniProfiler:

<package id="MiniProfiler" version="3.2.0.157" targetFramework="net452" />

I cleaned the project and restarted Visual Studio but with no success. What is happening here?

like image 511
Bassie Avatar asked Oct 08 '17 09:10

Bassie


1 Answers

So I manageed to find the cause of this when I double-clicked on MiniProfiler under References in the solution explorer.

This opens up an object explorer in the main window, which was displaying some references which were not visible in the solution explorer (how annoying), including MiniProfiler.Shared.

So I checked the path for these, and they were in the bin folder. After physically deleting the files, my error when away.

like image 123
Bassie Avatar answered Oct 05 '22 23:10

Bassie