Could not load type 'System.Web.Script.AjaxFrameworkAssemblyAttribute' from assembly 'System.Web.Extensions, - asp.net-4.0

I recently switched to VS 2010. While using AjaxToolkit version=4.1.51116.0, I am getting run-time error :
Could not load type 'System.Web.Script.AjaxFrameworkAssemblyAttribute'
from assembly 'System.Web.Extensions, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35'.**
This error is coming while using any of the AJAX toolkit control.
I am using ToolkitScriptManager.
How to solve this error?
suggestions are greatly appreciated.

Related

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.

System.IO.FileLoadException: Could not load file or assembly 'IBM.Data.DB2'

I am currently working on Outlook 2013 Addin Projects using visual studio 2013 and Visual Basic .Net. However, when I try to connect to DB2 Database. It shows that the dll files that I added into the project reference cannot be loaded.
What I do is add a new panes with a button in outlook which will look a windows form in outlook when the button is clicked. Onload the form, it will connect to DB2 and the below error message occur
System.IO.FileLoadException: Could not load file or assembly 'IBM.Data.DB2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c307b91aa13d208' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
File name: 'IBM.Data.DB2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c307b91aa13d208'
=== Pre-bind state information ===
LOG: DisplayName = IBM.Data.DB2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c307b91aa13d208
(Fully-specified)
LOG: Appbase = file:///C:/Users/D0259/Documents/Visual Studio 2013/Projects/OutlookAddIn3/OutlookAddIn3/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : OutlookAddIn3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: IBM.Data.DB2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7c307b91aa13d208
LOG: Attempting download of new URL file:///C:/Users/D0259/Documents/Visual Studio 2013/Projects/OutlookAddIn3/OutlookAddIn3/bin/Debug/IBM.Data.DB2.DLL.
ERR: Failed to complete setup of assembly (hr = 0x80131045). Probing terminated.
Other windows form project using the same dll is working. Really need some advice on this. Anyone face this error before? Viewers' help is highly appreciated.

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.

"Method 'Expire' in type 'ServiceStack.Redis.RedisNativeClient' from assembly

I get the following error when I try to load my webrole locally.
Method 'Expire' in type 'ServiceStack.Redis.RedisNativeClient' from assembly 'ServiceStack.Redis, Version=3.9.14.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
It was working yesterday... Any ideas?