Kernel dotnet: Cannot find Microsoft.CSharp.dll assembly file

I have a project that I have not run for a while, I'm building with cell dependencies 1.1.0.0.

while I updated visual studio, I might have installed some dotnet core stuff for 2.0 and my application no longer starts.

InvalidOperationException: Can not find assembly file Microsoft.CSharp.dll at 'C:\dev\EarthML\EarthML.Mapify\src\EarthML.Mapify.Portal\bin\Debug\net462\win10-x64\refs,C:\dev\EarthML\EarthML.Mapify\src\EarthML.Mapify.Portal\bin\Debug\net462\win10-x64\'
Microsoft.Extensions.DependencyModel.Resolution.AppBaseCompilationAssemblyResolver.TryResolveAssemblyPaths(CompilationLibrary library, List<string> assemblies)

What would I do to understand why it does not work?

+6
source share
5 answers

I upgraded the application to dotnet core 2.0 and shaving pages and bypassed the issue.

+1
source

This seems to be a bug in the current version of Visual Studio (15.3). The main problem is when Views are trying to create, they do not reference the GAC and therefore have no dependency.

, , , DLL. . ( Triaged: https://developercommunity.visualstudio.com/content/problem/96927/runtime-error-after-upgrading-to-vs-153-invalidope.html), .

, https://github.com/dotnet/sdk/issues/1488, :

<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.0" />
+4

Have you included the link Microsoft.CSharp.dll? Expand the project, right-click on References, click Add Reference, perform a search Microsoft.CSharp, check the box, click OK.

Choose Microsoft.CSharp

+1
source

I had <DependsOnNETStandard>true</DependsOnNETStandard>, and I had to change it to<DependsOnNETStandard>netstandard1.6</DependsOnNETStandard>

<PropertyGroup>
    <TargetFramework>net462</TargetFramework>
    <RuntimeIdentifier>win7-x64</RuntimeIdentifier>
    <IsServiceFabricServiceProject>True</IsServiceFabricServiceProject>
    <AssemblyName>MyProject</AssemblyName>
    <Platforms>AnyCPU;x64</Platforms>
    <DependsOnNETStandard>netstandard1.6</DependsOnNETStandard>
</PropertyGroup>

Source: From neman on GitHub Isue

0
source

clean the solution and rebuild it. if it didn’t work, create a new project, then copy the dll and paste. good luck.

-3
source

All Articles