Getting an Unexpected Error in dotnet core Project - asp.net-core

In my solution Explorer(Visual Studio) there are 5 projects
DigiIdentity(webapi)
Core(class library)
Data(class library)
Services(class library)
DigiPigmyApi(webapi)
DigiSyncApi(webapi)
I am getting following error while running the project(solution)
Error CS1705 Assembly 'Microsoft.AspNetCore.Hosting' with identity 'Microsoft.AspNetCore.Hosting, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' uses 'Microsoft.AspNetCore.Hosting.Abstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Microsoft.AspNetCore.Hosting.Abstractions' with identity 'Microsoft.AspNetCore.Hosting.Abstractions, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
Actually I am not finding the Microsoft.AspNetCore.Hosting.Abstractions, Version=1.1.1.0 package anywhere, can any one tell me the exact course of the error.

Related

The breakpoint cannot currently be hit after oracle dll change

I have a solution with several projects in vb, Visual Studio 2012. I just completed an upgrade task from System.Data.OracleClient to Oracle.DataAccess. When I build and run the solution it works fine but failed once I try to enter login info. When I put a breakpoint and build it in debug mode and try to step through each step, it only hits the first instance for page load and after that throws an error. It never reach the targeted breakpoint.
When I check my dll module, I noticed both the older version of the oracle data access and the newest one. And they both say “Binary was not built with debug information”
Any idea how I can resolve this issue?
Edit
I was able to run the command again, in the Developer Command Prompt for VS2015 this time. I am getting:
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe
C:\Program Files (x86)\Microsoft Visual Studio 14.0>gacutil /l | find "Oracle."
Oracle.DataAccess, Version=2.111.7.0, Culture=neutral, PublicKeyToken=xxxxxxxx, processorArchitecture=x86
Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=xxxxxxxx, processorArchitecture=x86
Oracle.Web, Version=2.111.7.0, Culture=neutral, PublicKeyToken=xxxxxxxx, processorArchitecture=x86
Policy.2.102.Oracle.DataAccess, Version=2.111.7.0, Culture=neutral, PublicKeyToken=xxxxxxxx, processorArchitecture=x86
Policy.2.111.Oracle.DataAccess, Version=2.111.7.0, Culture=neutral, PublicKeyToken=xxxxxxxx, processorArchitecture=x86
Policy.2.111.Oracle.Web, Version=2.111.7.0, Culture=neutral, PublicKeyToken=xxxxxxxxx, processorArchitecture=x86
Oracle.DataAccess, Version=1.111.7.0, Culture=neutral, PublicKeyToken=xxxxxxxxx
Policy.1.102.Oracle.DataAccess, Version=1.111.7.0, Culture=neutral, PublicKeyToken=xxxxxxxxx
Policy.1.111.Oracle.DataAccess, Version=1.111.7.0, Culture=neutral, PublicKeyToken=xxxxxxxxx
Policy.10.1.Oracle.DataAccess, Version=1.111.7.0, Culture=neutral, PublicKeyToken=xxxxxxxxxx
Policy.10.2.Oracle.DataAccess, Version=1.111.7.0, Culture=neutral, PublicKeyToken=xxxxxxxxxx
Policy.9.2.Oracle
You don't have to conceal the PublicKeyToken, they are public to everybody.
Anyway, I assume you messed up your Oracle installation. Most likely you had a working Oracle Client 11.1 (include ODP.NET) but then you installed ODP.NET (i.e. Oracle.DataAccess.dll) version 11.2 but without underlying Oracle Client 11.2.
Remove all your Oracle client installation (consult How to uninstall / completely remove Oracle 11g (client)?) and make a fresh installation of either Oracle 11.1 or 11.2 - or even the latest version 12.2.

asp.net core build error : 'HttpRequestMessageExtensions'

Using ASPNet Core 1.1 Web API template and trying to create a response on Post. Getting the below error while building the project. Thanks for your help !
Controllers\MessagesController.cs(37,28,37,72): error CS0433: The type
'HttpRequestMessageExtensions' exists in both
'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' and 'System.Web.Http,
Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
You should remove reference to System.Web.Http, as ASP.NET Core doesn't use it.

asp.net-core MVC rc2 using net451 on linux

I am trying to migrate my website from dotnet core rc1 to dotnet core rc2, but I faced an error, then I tried to run a small test and it also didn't work for me.
This is my teste: https://github.com/ricardoalcantara/WebApplicationBasic
My environment is:
Debian 8.4
Mono 4.2.3
dotnet 1.0.0-preview1-002702
I need to run it on top of the "framework": "net451" because my main project needs few libs which still just run on that platform, so I am running with this command line:
dotnet run --framework .NETFramework,Version=v4.5.1
it actually runs, but when I try to access localhost:5000 it throws a long stack error mainly with that message:
z2cw6v06.4ja(43,10): error CS0518: Predefined type 'System.Object' is not defined or imported
z2cw6v06.4ja(43,50): error CS0012: The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
z2cw6v06.4ja(43,10): error CS0518: Predefined type 'System.Void' is not defined or imported
z2cw6v06.4ja(45,10): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
z2cw6v06.4ja(45,10): error CS0518: Predefined type 'System.Object' is not defined or imported
z2cw6v06.4ja(45,50): error CS0012: The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
z2cw6v06.4ja(45,10): error CS0518: Predefined type 'System.Void' is not defined or imported
z2cw6v06.4ja(47,10): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
z2cw6v06.4ja(47,10): error CS0518: Predefined type 'System.Object' is not defined or imported
z2cw6v06.4ja(47,50): error CS0012: The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Can someone help me to solve that problem?
Obs.: It works on windows.
If you look closely, the error seems to be that MVC is failing to compile the view:
Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException: One or more compilation failures occurred:
pufduf6v.a1v(17,88): error CS1980: Cannot define a class or member that utilizes 'dynamic' because the compiler required type 'System.Runtime.CompilerServices.DynamicAttribute' cannot be found. Are you missing a reference?
pufduf6v.a1v(17,88): error CS0518: Predefined type 'System.Boolean' is not defined or imported
pufduf6v.a1v(17,47): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
…
But running dotnet publish and then executing the result directly using mono works for me, e.g. (on Ubuntu):
mono bin/Debug/net451/ubuntu.14.04-x64/publish/WebApplicationBasic.exe
As was already explained to you on Github, this seems to be a known issue.

Loading a DLL in the GAC

currently I have a problem with getting a DLL into the Windows GAC. I tried to follow the steps of creating a DLL and loading it as described in this blog post:
http://blogs.technet.com/b/cloudpfe/archive/2014/02/01/how-to-create-a-custom-authentication-provider-for-active-directory-federation-services-3-0-part-2.aspx
At the point where I try calling the following command:
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7514a164b89fa979")
I get an error which tells me that System.EnterpriseServices could not be found:
Exception calling "Load" with "1" argument(s): "Could not load file or
assembly 'System.EnterpriseServices, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=7514a164b89fa979' or one of its dependencies. The
system cannot find the file specified."
The specified DLL (System.EnterpriseServices) does exist* on the machine.
So now my question is, why can't this method find the DLL and what do I have to do/change to get this command to work?
NOTE: I Tried this on a vanilla Windows Server 2012 R2 with just ADFS parts installed; And I've called the command from the Powershell.
*UPDATE: The System.EnterpriseServices DLL resides in
C:\Windows\Microsoft.NET\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a
and
C:\Windows\WinSxS\amd64_system.enterpriseservices_b03f5f7f11d50a3a_4.0.9600.1638‌​4_none_53a3f9b13fac0ba5\
So it should be available from the GAC.
I think your public Key token is incorrect, you found your own answer with your update :) .
It should be
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Give this a try.

Problem running latest version of nhibernate

I downloaded latest version of NHibernate “2.1.0.2002”.
It built fine, but when I run my unit tests, I keep getting error :-
System.IO.FileLoadException: Could not load file or assembly 'NHibernate, Version=2.0.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
It looks like somewhere it looks of old version.
Here is link
https://stackoverflow.com/questions/839112/problem-while-migrating-nhibernate-to-higher-version
This is internal error I am getting:
=== Pre-bind state information ===
LOG: DisplayName = NHibernate, Version=2.0.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
(Fully-specified)
LOG: Appbase = file:///D:/Project Files/CIS3G/Webapp/_Test_DAL/bin/Debug
LOG: Initial PrivatePath = NULL
Calling assembly : CIS3G.DAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Project Files\CIS3G\Webapp\_Test_DAL\bin\Debug\_Test_DAL.dll.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: NHibernate, Version=2.0.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4
LOG: Attempting download of new URL file:///D:/Project Files/CIS3G/Webapp/_Test_DAL/bin/Debug/NHibernate.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Please check if you set the Specific Version-Property on your NHibernate Reference to 'true'? It doesn't seem to be the case on this error but with new NHibernate you need to provide an external ByteCodeProvider like Linfu.dll as well. Please check this also.
I've run into this before.
In my case the problem was that I was using a UnitOfWork implementation for handling Nhibernate sessionFactories.
I've been using this lib for a while so I just copied the compiled dll to a new test project with the new version of NHibernate, so I got the version problem.