MVC5 not generating Model from Database after NuGet update - asp.net-mvc

I am creating an MVC 5 Web Application with Visual Basic using Database First Approach. Recently I updated ALL NuGet packages and after that I'm unable to create Models from the Database.
As shown below, I can not select Tables and other DB objects from Database to include in my Model.
When I click finish, it generates an empty model as shown below:
One more weird thing I noticed is: As shown in this tutorial, it should show me a checkbox that says, Enable Extended Transact-SQL verification for common objects, but when I open the properties of my project, it doesn't show me this checkbox.
Now, my questions are:
If as I doubt, a NuGet package update has created this problem; which
package is it?
Is it possible to uninstall updates of NuGet packages
(as we do with Windows Updates)? If yes, How?
Any help would be appreciated. Please note that,
I've experience in Web Forms but I'm a beginner in MVC.
This issue
has started just after, I updated ALL packages when I was facing
this type of issue.
I created 3 projects with the same approach
before this update, and I succeeded every time generating the Models
from Database.
Please suggest!

Right click the .edmx file in the solution explorer and select 'open with..' Select the XML editor and open the file. Check if there are any errors in the file. Errors may show in the error list window or may show as comments in the file.

Related

Why Fortify Audit Workbench Source Editor is not opening?

I am using Fortify Audit Workbench 18.20.1071 to do analysis on already created Fortify projects. The Fortify projects (extension .fpr) were created using standard Fortify commands. The discovered code issues, are listed on the left pane, and are grouped by categories, depending on a predefined view. When clicking on those issues, I was previously able to see the code in the source code panel/viewer/editor (separate panel to the center-right). For some reason I am not able to open that panel anymore. I don't recall changing anything in the settings, but I'm not able to see the associated code anymore.
If I create a pdf Developer Workbook report, from the Fortify project, I am able to see the source code (in the pdf file), therefore I know that the source code is available. I assume it's just some Audit Workbench settings that I need to change, but I don't know which ones.
There is no code associated with my question, as it is related to the functionality of the Audit Workbench application.
What I expect to see is the following: When I click on a listed issue on the left pane, the source code file associated with the flagged issue should open on the pane to the center-right.
Any suggestion would be greatly appreciated. Thanks a bunch!
I had the same issue using ver 19.10 and here's how I got the source code tab to show again.
Reset the config (options/options/audit configuration/reset interface)
Reboot computer
Open audit workbench and reload project

Entities cannot be found after update edmx file

For the project I am working on, we have updated the database with two extra datatables that I now would like to add to the edmx file, but this gives an unwanted result.
What I do is open the edmx file, open the model Browser and run Update form database. In the wizard here I choose the two tables I want to add under the add tab and click finish.
The tables show up in the diagram view and in the Model browser under Model.Store-Tables/Views (and under Entity Types and EntityContainer). So far so good.
When I then save the changes to the edmx, all other existing entities,as well as the complete content of the Model.Context.tt file are deleted. The result being that the context entity and all underlying entities no longer can be found.
I do not understand why this is happening, and I don't know how to fix this and I am now stuck in the development of the project. i am using VS2015 and Entity Framework 6. I have spend most of the day to find a solution, but have not been able to do so. None of the "Entity can't be found" solutions around fixed my problem. I hope therefor that some smart minds here can help.
Thans!

App_Data folder is not checked in with Team Foundation Server [duplicate]

I am working with ASP.NET C# MVC 5.
.mdf/.ldf files in App_Data do not appear on Pending Changes in team explorer. Therefore I can't check them into TFS(visual studio online). I've tried recreating the project a few times and none worked. What might be the cause for this?
Go to Team Explorer and locate Excluded Changes and you should find it excluded. Right click the App_Data folder and include it.
But you might want to reconsider including the database files. As you're developing and testing, every little database interaction will trigger a change and most of those are trivial. Also, if someone else is working on this project, they may not want your database file to overwrite theirs when they Get Latest Version.
If you're using Entity Framework Code-First, the database is automatically generated when you build the project I believe, otherwise you just run the Update-Database command to do it. This lets everyone collaborating have their own local database file to work with. You can also utilize migrations to make updates to the database structure. If you want the database to be generated with pre-populated data, you should utilize the Seed method.
This is a general question. As already answered by 'Ty Morrow' in above comment there is an initial Seed Method in Entity Framework which ensures that all values are inserted. However there are many scenarios that you also need to work with the latest added / removed DB entries not present in the seed method.
Please perform the following steps to ensure that your data directory file is included in the source control.
Click App_Data folder and on encircled toolbar click on Show All Files as shown below in the snapshot
Right Click on your MDF (Data Source) File and click on Include in Project
Right Click again on your MDF File and click on Include in Source Control
Simply Check in the file by Right Clicking on root project folder link and file show be now part of Source Control

Adding Identity to an existing project

I've got an MVC project, and I want to add Identity to it, but I can't seem to find any good articles on how to do so.
Is there an easy way to add Identity to an existing project?
I already have a database with stuff in it
Well, in one respect, you simply have to add the Nuget package and start writing code with it, but I think you're probably talking about all the extras: the pre-written code and samples for doing things like password resets, two-factor auth, etc.
For that, no, there's not really an easy way, at least in the sense of click a button and go. What I would recommend is creating a new MVC 5 project with Individual Auth, and then adding the Identity Samples Nuget package to it. Then, open your existing project in another Visual Studio window and copy/paste or use the sample code as a guide for writing your own.
Here's a tutorial that I followed for adding ASP.Net Identity to an existing project. It's up to date and from a reputed source at the asp.net/identity site.
I will echo what Chris said. there is no "easy way" . here is a video link featuring Scott Allen (a pioneer in web dev (Video link)
You can check his other videos as well
I think the easiest way to do that is to do the following steps:
Install All Identity Packages from nugets to your existing MVC project.
Create New MVC Project and choose Authentication type: Individual Authentication.
Copy IdentityModels.cs and all related files including (controllers, views and IdentityConfig) from New project to an existing MVC project.
Add migration to create required tables on database.
I'm getting back there because I ran into this situation some time back and applied solutions from here.
In the meantime I found something simpler.
VS has you covered to actually scaffold the files.
Right-click the project ► Add ► New Scaffolded Item...
Then in the new dialog, select Identity and click Add.
On the next screen you'll be given a list of items to check. You don't need to but you can import all of them if you want. It will ask for the data context but there's not in my case. In yours it should be already filled.
Click Add, you're done.

Adding field to work item in TFS results in permission error

In TFS I have a started a Scrum project, but I want to add some fields to a Work Item.
So I'm following this tutorial on how to add Estimate and Completed work hour fields to a Work Item.
I added one field in the layout, like shown in the tutorial. But when I try to save it I then get the following error:
TF237113: You don't have enough permissions to complete the import operation.
I think I have all the needed permissions. I changed all my user permissions and also the permissions I have in the TFS project that I'm working on.
But so far no luck. Even when I try to add a field in the Layout tab that already exists, then it still gives me that error. Anyone any idea what I can try to solve this error?
It looks like you're using Visual Studio Online (Since I can see that you have a Windows Live ID), Visual Studio Online doesn't support process template customization at all at the moment. This is due to the fact that they release new versions of the service every 3 weeks or so, and having to consolidate and test all customization across all projects would be a major pain.

Resources