We are planning to switch to Visual Studio 2017.
For our Entity Framework 6 edmx file we use the EntityObject Generator extension to create us the desired ObjectContext.
This extension is only compatible up to VS2013 - inofficially up to VS2015. The solution to simply adjust the manifest file in the vsix does not seem to work for VS2017 though - I guess among others because the vsix architecture changed.
Is there a way to get the ObjectContext template without using an old Visual Studio? I assume the template is not always the same for each edmx file so it could simply be copy pasted from an existing project.
I just did this in VS2017.
Download the VS extension package "EF 6.x EntityObject Generator for C#" from MS. It's a *.VSIX file. Rename it to ZIP. open the zip file and inside that you find one more zip.
There you will see a TT file. Copy it out.
In your project that have a MyModel.TT file that generates DbSet just replace that TT file with the one you got from vsix file.
Edit one line:
SourceCsdlPath = #"$edmxInputFile$",
to your
SourceCsdlPath = #"myEDM.emdx",
save TT file and your c# model code is generated with old EntityObjects
Related
I recently inherited some source code developed by someone else who is no longer with the company. However, the solution file was missing and I'm not even sure which version of MVC it was using. I'm experienced with ASP.NET, but not well-versed in MVC so I'm unsure how to go about rebuilding the solution the proper way. Looking for any tips/guidance on how to go about this.
Create a new, blank solution.
Open the solution in Windows Explorer.
Copy the project files into the solution folder.
Within Visual Studio, right-click the solution in Solution Explorer, and then chose the option to Add Existing Project....
Navigate to the solution folder (if necessary), and then select the .csproj (or .vbproj) file. The project will added into the solution.
Now, whether you can compile the solution/project depends on whether the version of MVC is compatible with the tooling installed in your instance of Visual Studio. If the project has NuGet dependencies, they should be restored the first time you build, depending (again) on your version of Visual Studio and tooling.
Edited:
Since you say that even the project file is missing, you can, assuming there are no external dependencies, create a new MVC project and then copy/paste the files into it (or drag & drop the files from Windows Explorer). Assuming there is a Views folder, it will have it's own web.config file. That config file will have bindings for the version of MVC the project was developed with.
MVC4 and newer projects tended to default to using Razor syntax, so the views will be littered with stuff like #Model. If it's using the older WebForms syntax (like <asp:ContentPlaceholder>), it's probably MVC3 or older.
Go to web.config file in the project and look for:
assembly="System.Web.Mvc,Version=3.0.0.0 ..."
In this example is.MVC 3, look for your version
Is it possible to import an already existing Umbraco site into Visual Studio? (By means of getting all the site files and DB backup)
I've tried creating an empty project and copying the website files, but I get several errors when I try to compile the solution. The errors look like "Could not find scheme information for the element 'umbracoConfiguration'."
The same happens if I create an empty solution, add the UMBRACO nuget package, and then copy the website files.
I'm wondering if it is at all possible, or if once an UMBRACO website is running, how should one customize/develop on it?
THANK YOU!
After several attempts and trial and error, as well as reading other blogs, the way it worked for me was to go in Visual Studio -> File -> Open -> Web Site... and select the main folder containing all the files.
It is important to know that the web.config had to be modified in advanced for the website to work to point to the local server and off course attach the DB to the local SQL server.
Everything works perfectly just the way it was working on the host, and I have the solution in Visual Studio.
I like to start with nuget because it handles setting up all of my project references. I create a new MVC4 Web Application
Visual Studio->File->New->Project->MVC4 Web Application
After I create the new application, I open the Nuget Package Manager Console
Tools->NuGet Package Manager->Package Manager Console
I then enter the command:
Install-Package UmbracoCms.Core -Version 7.2.1
I find that installing the UmbracoCms.Core instead of the whole UmbracoCms nuget package is best because it only sets me up with the umbraco dlls and sets up the references for me. The UmbracoCms nuget package tries to do a lot more and is more handy if you are setting up a brand new umbraco site in Visual Studio.
Once I have nugetted the appropriate version of umbraco, I copy my existing umbraco site files over the files that were nugetted. When you copy all of the files over, don't copy all of the App_Data. Most of the files in that directory are TEMP files and cache files. From App_Data, only copy the following. This will save you time reindexing the site. I suspect a lot of the App_Data files were responsible for your Object Null Reference.
App_Data/access.config
App_Data/packages/*
In visual studio, in the solution explorer, click "Show All Files", and then include the appropriate files in the solution. Rebuild the solution, and you should be set up for development.
I have access to a working ASP.NET MVC 4 website through FTP but do not have the Visual Studio project file. Using these files can I create a Visual Studio project file?
If you have access to all the class files, views etc but are just missing the solution/project file then technically you can wrap them up in an empty project but it would still be a different project.
If you only have access to the published output (the views and JavaScript) then in short the answer is no, not without trying to reverse engineer the dll which I have heard is possible but have never tried myself.
i'm working on a project which is using mvc 5,ef 6.1, visual studio 2013. First i start coding from admin panel after its done i get back to admin panel for some changes.
Then i got those errors : http://prntscr.com/34tuby
ViewBag, Html Helper is not recognizing.
Project can compiling and working but when open a cshtml (view) file in visual studio i got those error.
for solution i tried;
Clean/Rebuild Project
Compare web.configs
Compare View web.configs
Compare project properties
Compare packages config
all packages same, web.config files same , all packages version same with working project.
-Thanks
Try checking your configuration file, as mentioned in this SO post. It's usually related to config entries not matching the correct DLL's.
I create new project and transfer all files with same namespace. And it work
It seems I cannot upgrade my ASP.NET MVC v1 project to be able to open it in Visual Studio 2010. Anyone noticed that already?
"The project type is not supported by this installation."
??
edit...I actually want to upgrade it to ASP.NET MVC v2 if possible. If not, I will probably create a new ASP.NET MVC v2 project and copy the files there and then try to build.
Can't seem to get it why there are no replies yet, didn't anyone try this out yet?
To upgrade an existing ASP.NET MVC 1.0 application to version 2, follow these steps:
Make a backup of the existing project.
Open the project file in a text editor (the file with the .csproj or .vbproj file extension) and find the ProjectTypeGuid element.
As the value of that element, replace the GUID {603c0e0b-db56-11dc-be95-000d561079b0} with {F85E285D-A4E0-4152-9332-AB1D724D3325}.
When you are done, the value of that element should be as follows:
{F85E285D-A4E0-4152-9332-AB1D724D3325};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
For additional steps read this.