ADO.NET Self-Tracking Entity Generator compile errors - c#

I can't figure out why I suddenly get these compile errors. Let's go through the steps I take:
1) I create a new MVC3 ASP.NET project (C#) using the Razor View engine
2) In my Models folder, I add an ADO.NET Entity Data Model, connect it to my database, and name it Database.edmx
3) I open my Database.edmx and select Add code generation item. I then add a Selft-Tracking Entity Generator and call it Model.tt
Everything is automaticly generated. When I hit build however, I get following compile errors:
Error 1 Cannot implicitly convert type 'System.Type' to 'MyOwnProject.Models.Type'
Error 2 'MyOwnProject.Models.Type' does not contain a definition for 'IsValueType' and no extension method 'IsValueType' accepting a first argument of type 'MyOwnProject.Models.Type' could be found (are you missing a using directive or an assembly reference?)
Error 3 'MyOwnProject.Models.Type' does not contain a definition for 'IsGenericType' and no extension method 'IsGenericType' accepting a first argument of type 'MyOwnProject.Models.Type' could be found (are you missing a using directive or an assembly reference?)
Error 4 'MyOwnProject.Models.Type' does not contain a definition for 'GetGenericTypeDefinition' and no extension method 'GetGenericTypeDefinition' accepting a first argument of type 'MyOwnProject.Models.Type' could be found (are you missing a using directive or an assembly reference?)
Error 5 Cannot implicitly convert type 'System.Type' to 'MyOwnProject.Models.Type'
Error 6 'MyOwnProject.Models.Type' does not contain a definition for 'FullName' and no extension method 'FullName' accepting a first argument of type 'MyOwnProject.Models.Type' could be found (are you missing a using directive or an assembly reference?)
Error 7 'MyOwnProject.Models.Type' does not contain a definition for 'FullName' and no extension method 'FullName' accepting a first argument of type 'MyOwnProject.Models.Type' could be found (are you missing a using directive or an assembly reference?)
To me, this makes no sense at all. I've created new projects with a database this way a dozen times and now, all of a sudden, I get these compile errors. It doesn't make a difference what I name the database, edmx or models. It also makes no difference wether the database sits in the App_Data folder, or on an external location on my hard drive.
Does anyone have any idea why this is failing? Thanks.

It looks like there is a table TYPES in your database that results in an entity class Type. This class hides the class System.Type. Change the name of your entity to something else, e.g. TypeEntity.

Don't call your entity "Type". There's a really, really important type in .NET already called Type. You will only cause yourself pain with this name. Pick a name which isn't the same as a built-in, fundamental type name.

Related

Unity Dotween Outline import issue

Assets\JMRSDK\Core\Plugins\DOTween\Modules\DOTweenModuleUI.cs(182,86): error CS1061: 'Outline' does not contain a definition for 'effectColor' and no accessible extension method 'effectColor' accepting a first argument of type 'Outline' could be found (are you missing a using directive or an assembly reference?)
Keep getting this error in Unity on importing a certain package that uses Dotween, can someone please help me with this?

How do I register a WFC host factory in a MORYX module?

The ProductManagement and ResourceManagement use the following command to do that
Container.RegisterWcf(WcfHostFactory);
But when I try to do that in my custom module, I get the following error message:
CS1061 'IContainer' does not contain a definition for 'RegisterWcf' and no accessible extension method 'RegisterWcf' accepting a first argument of type 'IContainer' could be found (are you missing a using directive or an assembly reference?)
Am I missing an assembly reference? And if that's the case: Which one am I missing?
In preparation for cross-platform we extracted WCF to an isolated package Moryx.Runtime.Wcf. That also contains the container extension.

I am getting reference error while adding the OrchardCMS in .NET Core application

Image 1
image 2
I am trying to add IServiceCollection.AddOrchardCms(); and I am getting the following error:
Error CS1061 'IServiceCollection' does not contain a definition for 'AddOrchardCms' and no accessible extension method 'AddOrchardCms' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) WebApplication1 D:\vibhan_pro\CMS\WebApplication1\WebApplication1\Startup.cs 15 Active

Where is the Update method in ServerManager?

I am trying to create a WebSite in IIS Version 8 by following this link
Added the reference to Microsoft.Web.Administration.
This line:
iisManager.Update();
gives this error:
'Microsoft.Web.Administration.ServerManager' does not contain a
definition for 'Update' and no extension method 'Update' accepting a
first argument of type 'Microsoft.Web.Administration.ServerManager'
could be found (are you missing a using directive or an assembly
reference?)
What am I missing?
Thanks in advance.
instead of Update try CommitChanges()

List.Exists missing within Portable Class Library

I am creating a Portable Class Library (PCL) and I am trying to use List.Exists() and List.TrueForAll(), but I am being told that System.Collections.Generic.List does not contain a definition for either Exists or TrueForAll. The PCL I am creating is to work across the .Net 4.5, Silverlight 4, Windows Phone 7.5, Mono Android, and Mono iOS. Is there something that I am missing?
Note: This code works in a .Net 4.0 Library which I have made.
Code Examples which return errors:
List<object> set0;
List<object> set1;
if (set0.TrueForAll(obj0 => set1.Exists(obj1 => obj0.Equals(obj1))))
return true;
if(!(set0.Exists(obj0 => !set1.Exists(obj1 => obj0.Equals(obj1)))))
return true;
Errors Recived:
Error: 'System.Collections.Generic.List' does not contain a
definition for 'Exists' and no extension method 'Exists' accepting a
first argument of type 'System.Collections.Generic.List'
could be found (are you missing a using directive or an assembly
reference?)
Error: 'System.Collections.Generic.List' does not contain a
definition for 'TrueForAll' and no extension method 'TrueForAll'
accepting a first argument of type
'System.Collections.Generic.List' could be found (are you
missing a using directive or an assembly reference?)
You seem to be trying to determine, in a cumbersome way, if set0 is a subset (mathematically) of set1. If you change your type from List<> to HashSet<> or SortedSet<>, you will get this functionality for free.
Otherwise, consider to use
set0.Except(set1).Any()
from Linq.
I'm not sure which methods exist in the Portable Class Library (PCL), but according to the List<>.Exists doc this method does. And also the Linq methods I mentioned.

Categories

Resources