I am new to mvc. I just installed the Visual studio 15 and when i create a mvc project and run it without any modification. it gives me the above mentioned error. I did the same thing on another pc and it works but on my system it gives me the error. search for solutions but could not find any specific. so please guide me what to do.
"Could not load file or assembly 'AAAAAAAAAA, Version=6.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxx' or one of its dependencies." is a common error. Try the following methods in order to fix this error:
Method I: Add the following key to the section in your web.config:
<compilation debug="true" targetFramework="4.5" >
<assemblies>
<add assembly="AAAAAAAAAA, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=xxxxxxxxxx" />
</assemblies>
</compilation>
Method II: If the problem is not solved, try to run this command on PM Console:
Install-Package AAAAAAAAAA
Hope this helps...
As Power BI Embedded release to official version 1.0, I tried to upgrade PowerBI nuget packages in my application from version beta to 1.0, everything works perfectly on localhost.
But when I deploy to the web server (IIS on Windows Server 2012 R2), I got exception:
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\ada706e8\d6adc8aa\App_Web_index.cshtml.1c5a15dd.b_ofojaq.0.cs(77): error CS0012: The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
I am not sure how to fix it, my application on .NET 4.6.1. I had to go back beta version for production until finding the way to fix it.
It fixed by adding the line:
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
into web.config:
<compilation debug="true" targetFramework="4.6.1">
<assemblies>
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>
....
</compilation>
Got an app with NancyFX, self hosted across multiple projects (self-host is running on Topshelf as a service/console app for debugging).
Replaced TinyIoC strapper with Windsor strapper.
Added registrations.
Added Castle.Windsor reference to all assemblies in project
Got this error:
[CS0012] Line: 128 Column: 18 - The type 'Castle.MicroKernel.Registration.IWindsorInstaller' is defined in an assembly that is not referenced. You must add a reference to assembly 'Castle.Windsor, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc'. (show)
Tried adding
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="Castle.Windsor, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc" />
</assemblies>
</compilation>
To app.config - nothing.
I'm getting the following error in a .Net c# MVC application, targetting the .Net Framework Version 4.5:
The type 'System.Net.Http.HttpContent' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
I have added the reference in the project, and I have even edited the web.config to include a reference to the assembly under:
<system.web>
<compilation debug="true" targetFramework="4.0"/>
Unfortunately, I cannot find any explanation why the Exception is happening. Has anyone had the same exception?
Consider checking the machine.config and other configuration files. In the above case, a corrupted machine.config was the problem.
I'm trying to use System.DirectoryServices in a web site project and I'm getting this error:
The type or namespace name 'DirectoryServices' does not exist in the namespace 'System' (are you missing an assembly reference?)
My project has a reference to System.DirectoryServices in web.config:
<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
And I do have using System.DirectoryServices in the files where I want to use it.
Does anybody have a clue where to look for the problem?
Right click on References under your solution.
Select Add Reference.
The reference can be found under the Framework Assemblies list.
Select System.DirectoryServices and click Add.
I think you should install Directory Services Package.
Install-Package System.DirectoryServices -Version 4.0.0
Directory Services Package
Shot in the dark: have you tried adding to the web.config:
<compilation debug="true">
<assemblies>
<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>
</compilation>
Is the web-server (IIS or whatever) configured to run the folder as an application (i.e. shows as a cog), and is it using the correct version of ASP.NET? If it is running as 1.1, bits of it might work - but it would fail to find that 2.0 assembly in the 1.1 GAC.
This is a very old thread but just to provide a complete answer for the sake of posterity ;)
This issue occurs if the project is missing a reference to the .Net Component System.DirectoryServices
Adding this reference in the usual manner prefered by you will resolve the issue.
Is this a web site project, or a web application project. With the latter, references are handled via the .csproj - i.e. via the "References" node in Solution Explorer.
On Solution Explorer right-click your project, then from the resulting menu, click on Add Reference, then under the .NET tab navigate to DirectoryServices.AccountManagement
These problems occur when you are working with older .net version and trying to build with the latest IDE
It depends on which version of IDE you are using and also the current code version.
Check the web config,
In my case, I was using the Latest version i.e 4.7 and directoryService assembly are still referring to C#4.0.
Add below if you are using Latest version of id i.e 4.7
<system.web>
<location>
<compilation debug="false" numRecompilesBeforeAppRestart="100" targetFramework="4.7">
<assemblies>
<add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.DirectoryServices.AccountManagement, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
</compilation>
</system.web>
</location>
I had the same problem when I tried to convert website to web-app.
It looks like vs failing to load the assembly should be related to versioning.
switch to web.config and add the assembly to it as bellow. make sure the DLL version is matching your application targeted .NET version.
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</assemblies>
</compilation>
</system.web>
</configuration>
for getting a public key you need to launch Developer Command Prompt for VS. Change to GAC directory related framework on above ex C:\Windows\Microsoft.NET\Framework\v4.0.30319
and call
sn -T System.DirectoryServices.dll