I lost quite some time on this annoying issue that sometimes affects my VisualStudio 2015 with the Devart Oracle Driver for using Entity Framework.
My changes in the database (for example a modification of a view) were reflected ONLY in the entity framework model (after selecting the usual Update Model from Database...) but the modified classes WERE NOT available in the code!
The solution is very simple: "Run Custom Tool"
Select your model file (the one with extension with .edml), right click an choose "Run Custom Tool".
Now the changes to your database are available in your code too.
Source:
https://blog.jongallant.com/2012/08/entity-framework-manual-update/
My Tips and Tricks for C#, C, C++, MatLAB, Java, LaTeX, Python and more!
Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts
Monday, March 12, 2018
Tuesday, December 5, 2017
[C#] How to fix the "Microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine" error
If you are trying to read an excel file in C# and you get this error:
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
You need to install "Microsoft Access Database Engine 2010 Redistributable" that is available at the Microsoft's website:
https://www.microsoft.com/en-in/download/details.aspx?id=13255
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
You need to install "Microsoft Access Database Engine 2010 Redistributable" that is available at the Microsoft's website:
https://www.microsoft.com/en-in/download/details.aspx?id=13255
Thursday, November 16, 2017
VisualStudio: How to indent all code in file
In VisualStudio to indent all code in the file you are currently working on:
1. Select all code: CTRL+A
2. Choose CTRL+K, CTRL+D
That's it!
1. Select all code: CTRL+A
2. Choose CTRL+K, CTRL+D
That's it!
Sunday, March 6, 2016
Google Test in Visual Studio
This post is for those who just need "a refresh" of the steps required to set google test with Visual Studio. If you are a newbie, please refer the excellent references at the bottom of this post.
Some simple actions will allow you to use the popular Google Test Framework in Visual Studio.
In a summary you will need to perform these steps:
1) Download the latest version of google test
2) Open and Compile in Visual Studio the TWO Visual Studio solutions you'll find in googletest/msvc: gtest.sln (static libraries) and gtest-md.sln (dynamic libraries)
NOTE: Before open gtest.sln and gtest-md.sln remember to unlock these files (right click and unblock).
3) Neglect the warnings in Visual Studio and
With the DEBUG configuration Build -> Build Solution
With the Release configuration : Build -> Build Solution
These steps will create the gtest libraries in msvc/gtest/Debug msvc/gtest/Release.
Debug:
gtest_maind.lib
gtestd.lib
Release:
gtest_main.lib
gtest.lib
NOTE the extra "d" in the Debug libraries (e.g. gtestd.lib vs gtest.lib)
4) To create a test project to support an existing project of yours you'll need to make the following changes in your test project:
That's it.
NOTE:
You have some linker errors like "Linker error LNK2038: mismatch detected for 'RuntimeLibrary'..."
Be sure that:
References:
Some simple actions will allow you to use the popular Google Test Framework in Visual Studio.
In a summary you will need to perform these steps:
1) Download the latest version of google test
2) Open and Compile in Visual Studio the TWO Visual Studio solutions you'll find in googletest/msvc: gtest.sln (static libraries) and gtest-md.sln (dynamic libraries)
NOTE: Before open gtest.sln and gtest-md.sln remember to unlock these files (right click and unblock).
3) Neglect the warnings in Visual Studio and
With the DEBUG configuration Build -> Build Solution
With the Release configuration : Build -> Build Solution
These steps will create the gtest libraries in msvc/gtest/Debug msvc/gtest/Release.
Debug:
gtest_maind.lib
gtestd.lib
Release:
gtest_main.lib
gtest.lib
NOTE the extra "d" in the Debug libraries (e.g. gtestd.lib vs gtest.lib)
4) To create a test project to support an existing project of yours you'll need to make the following changes in your test project:
- Be sure your Runtime Library is the same in BOTH project AND it is consistent with the google test libraries you are using: e.g. if you compiled gtest.sln YOU need to set a multi-thread runtime environment : /MT and /MTd , for release and debug solution, respectively. This is set in General Properties -> C/C++ -> Code Generation. Distinguish between Release and Debug
- In General Properties set correctly Include Directories and Libraries Directories
- In General Properties -> Linker -> Input-> Additional Dependencies add the previously generated google test libraries at point 3. Distinguish between Release and Debug.
- Make your test project dependent on your NON-test project. Select your test project from the solution explorer. Right Click -> Build Dependencies -> Project Dependencies : Your NON-Test project should be listed among the available projects.
That's it.
NOTE:
You have some linker errors like "Linker error LNK2038: mismatch detected for 'RuntimeLibrary'..."
Be sure that:
- Runtime Libraries match between your TEST and NON-Test projects
- The gtest library you are linking is consistent with the runtime Library you chose: /MT and /MTd require gtest_main.lib/gtest_maind.lib (static libraries) and gtest.lib/gtestd.lib (static libraries) while /MD and /MDd require gtest.lib /gtestd.lib (dynamic versions) and gtest_main-md.lib / gtest_main-mdd.lib (dynamic versions).
References:
- All you need to know and more for the setup: http://www.codeproject.com/
- Another setup tutorial: https://blog.knatten.org/
- Some basic usages of google test (available as pdf too): http://www.ibm.com/developerworks
Labels:
C++,
google test,
gtest,
howto,
MSVC,
Visual Studio,
Visual Studio 2015
Subscribe to:
Posts (Atom)