I got the error message Could not load file or assembly ‘system.web.http’ file not found when running custom tool on Typelite. File not found. This was after updating some nuget packages.
The issue is that apperently there are several version installed. How to get rid of this misery:
– start the nuget package manager console in Visual Studio
– type: update-package (all packages are updated)
– type: get-package (you get a list of installed packages)
– remove all packages from old versions (e.g.: uninstall-package xxxx.yyy -Version 1.0.0)
– if still an old assembly exists in the references, delete it and reinstall the package (Update–Package <PACKAGE> –reinstall
– run update-package again
If you get a message that the package is not installed, install it! (install-package <PACKAGE NAME>
All should work now (at least it did for me)
Using Entity Framework 6.0 I got this message. This problem occurs when mostly in Async environment. This is due to a reader (in the same DBContext) that is still open, while another reader tries to open an new one. Typically this is a async issue.
In my MVC 5 app I have a Async call to my webapi. My problem was that I created a second repository object in a method, while the first repository was created by Unity Dependency Injection Framework was not finished reading.
In stead of newing the repository up in the method I injected it in the constructor and all issues where solved.
A better solution:
Add MultipleActiveResultSets=True to the connectionstring of the database.
Strange thing today. I have a MVC 5 webapp, that has Webapi capabilities used. Problem is that I get old data when retrieving it from a Webapi controller, but fresh data when retrieving directly from the database.
The issue was in the user of automapper. I had automapper map a datetime taking the timezone in account. I had to search in the database to get the right timezone. There the old value was presented. Probably due to Dependency Injection, there was a different databasecontext loaded, that did not see changes made.
Solution: quit using automapper and map the properties manual in my own Mapper class.
When rendering a CSHTML webpage that includes a PartialView (or is a PartialView) when using MVC you get the error message:
The “RenderBody” method has not been called for layout page
This typically occurs when you:
– have a partial view
– use a _ViewStart.cshtml page
– you call the partival view from your controller using: return View();
And there you go wrong. It is a partial view, so you should return like this:
That’s all there is to it.
Recently I started working with Typescript. I’ve noticed that I made some Typescript Common errors and issues for newbies. So I’ve deceided to blog about them. I hope others can benefit from this:
SCRIPT1004: Expected ‘;’
You’ve probably NOT include the .js file in your HTML file. Include the file <script scr=”YOURFILE.js”></script> in the HTML page.
Error 3: (this error occurs at Typescript compile time, in the editor, at compile time)
Invalid ‘new’ expression
You must include the correct namespace for the class to create:
Wrong: new Project();
OK: new MySolution.Classes.Project()
Error 4: (this error occurs in the editor, at compile time)
The property XX does not exists on value of type YY
public Project: Myapp.Models.ProjectInfo;
Although you’ve probably used Intellisense when editing. Still this error does appear. You must include a reference to the .ts file. Put the following line at top of the Typescript file that generates this error:
/// <reference path=”PATH TO YOUR TS CLASS FILE”/>
Supplied parameters do not match any signature of call target: type ‘XYX’ is missing property ‘concat’ from type ‘XYX’
The parameter expected is an array of XYZ, but the passed parameter is XYZ. Replace the parameter with the correct one (should be an array in this case).
Hope these error messages and the solutions I have provided you, will give you a head start. In my case, most error gave me a terrible a headache.