MVC 3 errors with Temporary ASP.NET Files - asp.net-mvc-3

I am taking over a ASP.NET MVC 3 project from a friend who has not got the time to work on it. I copied across all his files, setup the database etc and then opened it in VS2010. I proceeded to change the MS-SQL connection settings and then started the project in debug mode in VS.
As a note we are both using Framework versions v4.0.30319
It ran fine 100% without issue. I then closed the project, shut off the machine and now need to get started on adding some items to the website. I ran the site with VS again and go an error, specifically with the Frameworks web.config file, saying:
Error 77 Could not load type
'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider'. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config
Looking this up I found a resolution to this issue at http://forums.asp.net/t/1698282.aspx/1 and they solved it by adding the following line to the site apps web.config:
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
Running the site again now produced two errors:
Error 77 The type or namespace name 'ChangePasswordModel' does not
exist in the namespace 'ComputechIT.Models' (are you missing an
assembly
reference?) c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary
ASP.NET Files\computechit\1111c5a1\826189ca\App_Web_43fo251f.0.cs 184
Error 78 The type or namespace name 'RegisterModel' does not exist in
the namespace 'ComputechIT.Models' (are you missing an assembly
reference?) c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary
ASP.NET Files\computechit\1111c5a1\826189ca\App_Web_43fo251f.2.cs 184
Researched further and found that someone mentioned removing the obj directory and contents from within the project folder, which I did, to no avail.
So am a little stumped now as to why this site worked fine the first time I used it. Something seemed to have changed between then and when I next turned on the PC and tried to run the site.
I've done no updates of any sort on this PC. Any help would be appreciated.

Related

Xamarin compile issues

I'm experiencing alot of errors on a big project i've been working on for quite a while now.
Out of nowhere, my VS2017 doesn't recognise any xamarin references.
The project compiled flawlessly a couple of hours ago.
Example
I get 119 errors because of this when i try to compile.
For a solution, i tried to uninstall a nuget package: Xamarin.Android.Support.v4, this resulted in me not being able to install it back because i keep getting these errors when i try to install the package.
I have Xamarin.Forms installed. The bug started not being able to find certain dll files from my .net framework, i tried to solve this by giving direct references to the files, but it kept on not being able to find new dll files.
I always keep a backup on Github for reasons like this, but for some reason, the github project gives me the same bugs! It didn't when i saved it last night. This tells me my environment is screwed up, and for all i've done, i only seem to make it worse, so i don't want to mess up anything more.
Error message:
The type or namespace name 'Thickness' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?
The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'XamlCompilationAttribute' could not be found (are you missing a using directive or an assembly reference?)
(This continues for all 119 errors)
New error
Try checking your window's updates. I had the same issue a couple of hours ago and solved it with a system update
try deleting the package folder, and let it restore, Also remove Xamarin.forms nugget then install it again

Dotnetnuke 8 module development error in visual studio 2013

I have successfully installed DNN 8 and all configuration.
i am also referring video to develop module in visual studio.
https://www.youtube.com/watch?v=AKCYRPuoXF4
when i am trying to build the project then
error comes like:
Error 17 The type or namespace name 'DotNetNuke' could not be found
(are you missing a using directive or an assembly
reference?) C:\websites\dnndev.me\DesktopModules\MyDNNModule\MyDNNModuleModuleSettingsBase.cs 13 7 MyDNNModule
Please help to solve that.
thank you in advance.
Working with DNN8, sometimes I get a set of errors with message
The type or namespace name 'DotNetNuke' could not be found (are you
missing a using directive or an assembly reference?)
, probably 10 or 15 of them, and all located on top of one ascx file. (My dotnetnuke.dll is correctly placed in DNN's bin folder). Taking a better look (scroll down!), I can see that - except them - there are some more error messages (maybe just one of them), and that those additional errors are perfectly clear and logical. So I correct my source code in order to avoid those additional messages, and when I do that - those problematic messages also disappear!
In my case it took me a while to find the solution to this problem, since it only got triggered when I made a change to the View.ascx file.
You need the Visual Studio project to target framework to 4.5 instead of 4.5.1.
I got this solution from here.
Make sure to add a Reference to dotnetnuke.dll in the c:\websites\dnndev.me\bin folder
I honestly haven't done anything with DNN 8 CTP yet, I would stick with 7.4.1 until 8 is official released.

Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0

I've had a look at similar postings but haven't found one that has helped fix this issue.
Just briefly, I have an mvc3 project running on azure. A couple of days ago it lost it's reference to System.Web.MVC for some reason. So I added the reference and changed the Copy Local property to True.
It built and ran on the local emulator ok. I then published it and got the following message when visting the website.
"Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0"
It turns out I only version 3.0.0.1 and not 3.0.0.0 which is stated in my web.congig file. I've tried changing the value in web.config in both the assembly and runtime sections to 3.0.0.1 but this throws another exception in azure.(although didn't change the Public Token)
I've also tried Add Deployable Dependency but this has made no difference and I've tried downloading and adding vers 3.0.0.0 to the project but vs didn't like this dll when publishing.
I've also tried changing the property Specifc Version for the assembly to False but this hasn't worked.
So for some reason I don't have v3.0.0.0 anymore but don't know how to change my project to use v3.0.0.1 I guess.
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
Line 39:
Line 40:
Line 41:
Line 42:
Line 43:
Source File: E:\sitesroot\0\web.config Line: 41
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 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].
Thank's guy's. I actually just commented out the assembly line of code for the mvc assemble and changed the runtime binding code to look for v 3.0.0.1 in web.config and this has done the trick. I'm not sure if that was the best solution but having spent over a day on it time was a big factor.
I was getting a very similar error
My solution had previously been working and nothing had changed apart from some activities using source control
I created a completely new workspace and checked out the entire source code again to the new workspace, and this fixed the issue (just doing a 'get' and a 'Get Specific Version' wasn't enough)
Looks like something had got screwed up in my workspace that prevented the compiler from finding the correct .dll. Possibly related to finding it in the GAC?
I have had this problem on and off randomly for a while and I now know why.
When you update a nuget package and the package has a web.config file as part of the nuget package, it merges the content of web.config file in the nuget package with your config file. The nuget package was a private package that I build and didn't realise this.
The web.config file in the package contained the binging redirects for MVC and this causes my config file to suddenly have duplicate entries. I initially missed it because it does all the binding redirects on one line.
Once you remove any duplicate binding redirects it fixes the problem. This question was big clue to me finding out what causes this.

System.Web.Helpers does not exist in namespace: WebImage

While I know this has been "answered" about 50 million times, I haven't found an answer that fixes the issue for me, so I feel like I have no choice but to ask again.
Previous suggestions:
Razor pages in MVC are giving a compile error with System.Web.Helpers not being found
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
I have added this to my web.config, but the issue remains.
Type or namespace name does not exist
I only have one project, and the targetFramework is 4.0.
I installed Microsoft.Web.Helpers 1.15 (2.0 is incompatible with MVC3.) The Microsoft.Web.Helpers.dll is in my bin folder.
The odd thing is that there's Microsoft.Web.Helpers and System.Web.Helpers. I need System.Web.Helpers in this case, because I'm using WebImage in my code.
As I keep telling people, it's when I ask for help that I find the answer. In my case, somehow in the process of destroying my Solution earlier by upgrading to Microsoft ASP.NET Helper Library 2.0 and then trying to undo that action, System.Web.Helpers stopped being a referenced assembly in my project. Simple fix!
Of course, fixing that led me to the next Assembly Reference error. I think I'll be here all night.

PortableLibrary Could not load file or assembly

I have asp.net 4 webforms website which references PortableLibrary project. In the website I serialize classes from PortableLibrary. When I deployed the project to webserver machine with IIS6 I'm getting following error:
Could not load file or assembly 'System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
the portable library project references System.Xml (v4.0.31029).
When I tried to deploy clean project without references, just with simple serialization of string object, it worked fine.
A tried assemblybinding in web config but without success.
Why I'm getting this error? I have no idea from where comes the '2.0.5.0' version of system.xml.
answer from here: http://visualstudiogallery.msdn.microsoft.com/b0e0b5e9-e138-410b-ad10-00cb3caf4981
which worked for me
We'll have clearer docs around this when we release, however, you need to have Update for Microsoft .NET Framework (KB2468871)[1] installed on the web server. You will also need to remove the the binding redirect - this will actually have the reverse effect of disabling the feature. :) [1] http://www.microsoft.com/downloads/en/details.aspx?FamilyID=41bdce1f-3cb3-44bb-9b33-23a1b8c99ac3&displaylang=en

Resources