After updating edmx Model.Designer.cs become blank - asp.net-mvc

I am adding new table in database. Then for that when i am updating Edmx designer file become blank it's only contain:
"// Seeing this comment implies that the code generation for file
'E:\PrognoHealth\trunk\Development\PrognoHealth\PrognoHealth_MT\PHModel.edmx'
// failed. See the ErrorList for details."
And error list contain like
"Severity Code Description Project File Line Error CS0246 The type or
namespace name 'PrognoHealthEntities' could not be found (are you
missing a using directive or an assembly
reference?) PrognoHealth_MT E:\PrognoHealth\trunk\Development\PrognoHealth\PrognoHealth_MT\Partial\Address.cs 18
" error
Thanks in advance.

Please Check your EdmxFileName.context.cs file.

Check your EdmxFileName.context.cs file. Th class name must be "PrognoHealthEntities".Also check constructor name.

Related

Using _ViewImports.cshtml File

I made this _ViewImports.cshtml File, which inside refers to Models namespace in my Models folder.
Now in my Index.cshtml page when I want to remove "#using Razor.Models.Products " I encounter an error
now I'm sure I did it right since when I use the "# using expression" , it says its redundant:
what could be the problem?

Error 43 The type or namespace name 'ViewAsPdf' does not exist in the namespace 'Rotativa' (are you missing an assembly reference?)

I am getting this error:
Error 40 The type or namespace name 'ViewAsPdf' does not exist in the
namespace 'Rotativa' (are you missing an assembly
reference?) D:\SandeepPatil\PPD_Projects\Code\Karma_Retail\Karma.Store\Areas\Admin\Controllers\OrderController.cs 1757 45 Karma.Retail.Web
You may be missing the reference to the Rotativa dll which was reported as an error in version 1.7.3, found here. There's now a prerelease version 1.7.4-rc which presumably fixes this issue.
This error is caused by trying to instantiate a Rotativa.ViewAsPdf object which, I am pretty sure, is not an object but a static method of the class Rotativa.
From the surrounding code I can read on your screenshot, I can assume the method ViewAsPdf returns a byte array, in which case the simplest solution would be to remove the new in front of it, which serves absolutely nothing in that case.
Please note that this answer is only based on assumptions due to the low amount of informations provided by your screenshot. You might want to publish your code in the question for us to better understand the context.

Unable to retrieve metadata for 'MVCMusicStore.Models.Album

In section 5 of the ASP>NET MVC Music Store example, "Creating the StoreManagerController," when I click "Add" I get the error,
There was an error running the selected code generator:
'Unable to retrieve metadata for 'MVCMusicStore.Models.Album.'
The popular solution is to comment out the connection string in Web.config. This did not work for me. After trying many things I decided to add the code manually, by taking it from the completed code that's included with the example. When I do that I receive the error,
Compiler Error Message: CS0234: The type or namespace name 'Album' does not exist in the namespace 'MvcMusicStore.Models' (are you missing an assembly reference?)
and on line 31 I see the error,
public class _Page_Views_StoreManager_Index_cshtml : System.Web.Mvc.WebViewPage<IEnumerable<MvcMusicStore.Models.Album>>
Album is defined in the models folder. I have used webform development many times and am trying to add MVC to my repertoire. It seems to me "Album' is not registered, but I don't even know if that's appropriate lingo for MVC. What's the problem? I'm running this example in Visual Studio 2017.
The problem with line 31 is my project is named "MVCMusicStore". In the completed code I imported it's "MvcMusicStore". So it's looking at the wrong thing for the 'Album'namespace. Still don't know what causes the first error.
After correcting the namespace in the sample file, that error goes away and the new error is on the line;
#foreach (var item in Model{
the error is "System.NullReferenceException 'Object reference not set to an instance of an object.'

Universal Image Loader namespace error

In Xamarin, I have added the "universal-image-loader-1.9.2-with-sources.jar" as a file in the "Jars" folder of a binding project, I have then built the application but I am getting one error.
Here is the error:
Error CS0234: The type or namespace name 'DiskLruCache' does not exist
in the namespace
'Com.Nostra13.Universalimageloader.Cache.Disc.Impl.Ext' (are you
missing an assembly reference?)
Can I please have some help to get this code working?
Thanks in advance
You need to add the binding project as a reference in your Startup project.
To do so click on References directory in you solution tree and select the binding project in the "Projects" tab.
Good luck!
You need to create the Bindings Library project and then add this jar into the folder Jars.
For fixing error:
The type or namespace name 'DiskLruCache' does not exist in the namespace 'Com.Nostra13.Universalimageloader.Cache.Disc.Impl.Ext'
add to Transforms\Metadata.xml
<attr path="/api/package[#name='com.nostra13.universalimageloader.cache.disc.impl.ext']/class[#name='DiskLruCache']" name="visibility">public</attr>

Resource namespace not exist if resource file named using culture prefix

I have a resource file named Res.en.resx in my Asp.Net Mvc 4 project.
In a view I'm trying to access its properties like this: #MvcApp.Resources.Res.Title but I'm getting the following error:
The type or namespace name 'Resources' does not exist in the namespace 'MvcApp' (are you missing an assembly reference?)
If I change resource name to Res.resx everything works fine.
Why is this happening?
I believe you need to have at least a file named xxx.resx which contain the translation for the default language of your application.
So if your main language is french and you would like to have an english version, you need:
xxx.resx file which contain the default language of your app.
xxx.en.resx file which contain the english version of your file.
Hope this help!

Resources