Webconfig error with the site online - web-config

I'm trying to publish a web site.
The publication works perfectly, but when I try to access the address it returns me the following error:
Parser Error Message: Could not load
file or assembly
'Microsoft.Web.Helpers' or one of its
dependencies. This assembly is built
by a runtime newer than the currently
loaded runtime and cannot be loaded.
Source Error:
Line 293:
Line 294:
Line 295: Line 296:
Line
297:
Source File:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config
Line: 295
Assembly Load Trace: The following
information can be helpful to
determine why the assembly
'Microsoft.Web.Helpers' could not be
loaded.
WRN: Assembly binding logging is
turned OFF. To enable assembly bind
failure logging, set the registry
value
[HKLM\Software\Microsoft\Fusion!EnableLog]
(DWORD) to 1. Note: There is some
performance penalty associated with
assembly bind failure logging. To turn
this feature off, remove the registry
value
[HKLM\Software\Microsoft\Fusion!EnableLog].
This does not happen when I'm running on the local site.
The application was developed and Sql Server WebMatrix Compac 4

If you read the error message it says "Could not load file or assembly 'Microsoft.Web.Helpers' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded." If you then look at the version of the ASP.NET that this site is attempting to run under, it is ASP.NET Version:2.0.50727.4209.
Web Pages and the Web Helpers library need Version 4.0. Make sure the site targets the correct version of ASP.NET.

For missing assemblies a simple solution is to just bundle them with your project.
Go to your project -> references -> find this microsoft web helpers ref -> open the properties panel and set Copy Local to True
Edit: Also try setting assembly binding logging.

I suspect that your web.config is fine and that there is an assembly missing from your deployment.
You probably have to include microsoft.web.helpers in your deployment package or simply copy it to the bin folder.
You might find that there are other assemblies missing but you should be able to pick them off one by one.
There is a previous question Hosting WebMatrix Page
that lists all of the dlls you have to deploy and also suggests using Webdeploy

Related

System.IO.FileNotFoundException: Unable to resolve assembly 'nameOfDll'

Have a Visual Studio 2010 application that use Entity Framwork to bind controls. After publishing the application to IIS 7.5, I get the following error stack trace message.
This does not happen when run local!
System.IO.FileNotFoundException: Unable to resolve assembly 'nameOfDll'.
After many hours and days of research and following all suggestions, the error still is rendered.
I made sure that all references were loaded locally and set CopyTo: to true for each reference. The only other suggestion was to set the ContextTypeName in the EntityDataSource definition. I am not certain the correct value to enter.
I have also encountered this on IIS 6.0.
You will often get this type of error when there is a version or culture mismatch for a DLL where a specific version and/or culture is demanded.
Use the Fusion Log Viewer (Fuslogvw) to log binding errors. NOTE: You must run it as Administrator or it will silently fail to log.
http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx
The output of Fuslogvw will tell you exactly what attempts were made to satisfy binding requests, and why they failed.
If this is in an environment where you can do so, stop IIS, start Fuslogvw, start Fuslogvw logging, then start IIS again and browse to the problematic website. If you cannot stop IIS, I believe it should be sufficient to recycle the relevant application pool with Fuslogvw running and logging.

asp.net MVC 4 deploy on azure Could not load file or assembly 'DotNetOpenAuth.Core'

Hello I am trying to deploy asp.net MVC 4 project on azure
but I get this problem. I searched a lot about the solution but it looks like none
suit my case, this is the Error message I get :
Could not load file or assembly 'DotNetOpenAuth.Core, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
Before the dotnetopenAuth have no reference in my project I downloaded
but still get the same error .
Anyone have an idea?
I know this is old, but I came across a similar problem and this question popped up as the closest case. This was my issue:
http://developers.de/blogs/damir_dobric/archive/2013/09/26/windows-azure-websites-error-could-not-load-file-or-assembly-dotnetopenauth-core.aspx
Being, a previous MVC project had been deployed, which contained these references. I deleted them by downloading the publish profile, and, with the "Remove additional files at destination" option checked, I published to Azure.
While publishing, you can select "Remove additional files at destination" and then publish again.
I ran into this issue with continuous deploy between visual studio online and azure.
I modified my build file and changed the "Do Not Delete" setting under "Deployment" in the "Process" Tab to False.
Good to go.
This is a case of version mismatch. The error itself says that manifest definition does not match.
Look carefully at the version of the referenced assembly and the version shown in error message.
In case you are not using openauth you can remove it's reference all together.

trouble with service reference

I added a service reference that points to http://api.microsofttranslator.com/V1/soap.svc in my project. After adding the reference an app.config file was created.
When I run the project everything works. After creating a setup file with Advanced Installer (program for authoring Windows Installer setup packages) I get the following error message when I run the installed program.
"Could not find default endpoint element that references contract TranslatorService.LanguageService in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."
Can someone help?
This problem is not generated by the setup package created with Advanced Installer, it seems to be .NET specific. Here is another similar thread: Microsoft translator error

Enterprise lib 5.0 not detecting app.config

I have a Solution which contains a Web project and a Class Library project. The Class library project contains Enterprise library 5.0 and app.config. When I try to perform a Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write, I get the following exception:
Resolution of the dependency failed,
type =
"Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter",
name = "(none)". Exception occurred
while: while resolving. Exception is:
InvalidOperationException - The type
LogWriter cannot be constructed. You
must configure the container to supply
this value.
----------------------------------------------- At the time of the exception, the
container was: Resolving
Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter,(none)
If I move all the class files to the web project and have the Enterprise library configuration in the Web.config, everything works fine. I guess the issue is that the Enterprise library is not detecting the app.config which contains all the configuration.
Kindly help me with this regard.
Thanks in advance.
.NET dlls don't have config files. AppDomains do. You cannot put any configuration in a dll's "app.config" file and expect it to get automatically picked up. This is the way .NET config files work; it's not that "entlib is not automatically detecting" it, it's doing what the .NET framework defines the behavior of config files to be.
The answer is to leave the code in the library, but put the configuration in the web app's web.config file. Then everything will just work.
There are more advanced things you can do like manually loading the config file, but they're fairly advanced and, particularly with logging, can cause admin headaches later.

WCSF Random assembly manifest definition does not match assembly ref in .NET 2.0

I'm running WCSF Feb 2008 along with Enterprise Library 3.1 and noticed that randomly I get the "fun"
Could not load file or assembly Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, Public ... The located assembly's manifest definition does not match the assembly reference.
Usually this wouldn't be worth mentioning on stackoverflow, but the strange thing is that the first time I fire this up it breaks, but if I close it down and simply hit F11 again - it works .... strange. Does anyone know why this might break sometimes, but not others?
The problem was related to my version of the data access DLL I was adding. I found that if I went to the following:
C:\Program Files\Microsoft Web Client
Software Factory February
2008\Microsoft Practices Library
and imported this specific data access DLL instead of the one I compiled myself from the Enterprise Library 3.1 installer, everything worked great.