Error using MongoDB.Web: MongoDB.Driver.SafeModeResult MongoDB.Driver.MongoCollection.Insert(!!0) - mongodb

I am getting the following error using the MongoDB.Web membership provider:
Method not found: 'MongoDB.Driver.SafeModeResult MongoDB.Driver.MongoCollection.Insert(!!0)'.
I have the simplest of implementations:
Visual Studio Express 2012
Empty Website project (VB.NET) with a standard index.aspx added
Nuget packages: MongoDB.Web 1.2, mongocsharpdriver 1.7
MongoDB db version 2.2.3
Windows 7 64-bit
(All Mongo elements downloaded fresh today.)
I copied and pasted the Membership provider web.config details from the FreshLogic site, and modified only the database and collection attributes to reference my desired collection.
I have one line of code in the Page.Load event of my index.aspx:
Membership.CreateUser("fred124243", "Passw0rd$123")
I get the aforementioned error when I run the solution. I can see that my collection gets created, so the solution is communicating with MongoDB.
Any help greatly appreciated!

Answering my own question... I had to download MongoDB.Web source from Git and recompile.

Related

Reverse Engineering Code First With MySQL

Can someone help me with this problem??. I want use "Reverse Engineering Code First" with entity framework used MySQL. I was installed odbc, connector .net etc but still I cant see this... I did everything in this topic (and I have this same problem): Can't use a MySQL connection for entity framework 6
but still doesnt work :(. I was record all steps what I do it.. (Sry for english): https://youtu.be/xqEgCsu7_eU
I've gotten it to work with MySql Connector 6.9.11. Its so darned difficult and fragile I'm not sure if it was ultimately a good idea. There are at least 10 things that can go wrong and suck up hours of time. Once you get it working be very careful to not change anything. Anyhow. Here's some of my notes:
WARNING use with MySQL server 5.6.39 or 5.7.19. Do NOT use MySQL server version 5.7.21 (it fails with reverse eng) Aurora seems ok.
Install "mysql-connector-net-6.9.11.msi". There seems to be a problem with newer MySQL Connector 6.10 ?? use older 6.9.11. MUST INSTALL VIA msi file. Having the local file is not enough.
Install "mysql-for-visualstudio-1.2.8.msi" or "mysql-for-visualstudio-1.2.7.msi" ? NOTE: 1.2.7 will never uninstall correctly. VS 2015 seems to require "MySQL for Visual Studio" for EF Poco to work, (Pro,Enterprise are different)
Must have "Entity Framework Power tools Beta 4" installed as a plugin to Visual Studio 2013. Its takes some effort to get it to install for 2015, 17 but it can be done.
https://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d
Things that can go wrong:
ISSUE 1:
you get error "One or more errors occurred while processing template 'Entity.tt'."
This ALWAYS happens the first time i use reverse engineer after restarting VS.
Simply changing the .NET assemmbly version seems to do the trick. Target .NET 4.5 (not 4.5.1) for reverse engineer.
use .net4.5 for EF. If you see exception "System.ArgumentException: Empty path name is not legal."
remember to change back to 4.5.2 or greater.
VS2015 Edit and Continue is supported for 64-bit projects that target the .NET Framework 4.5.1. (or 4.5.2)
ISSUE 2:
System.ArgumentException: The specified store provider 'MySql.Data.MySqlClient' cannot be found in the configuration, or 'MySql.Data.MySqlClient' is not valid.
This appears to be an app/web.config issue.
??? MySql.Data.MySqlClient has more than 1 entry in in app.config ?? or bindingRedirect is wrong ?? might be wrong version consistently 6.9.11 ? MySql.Data.MySqlClient
?? Install correct version 6.9.11 in GAC not just nuget ? mysql-connector-net-6.9.11.msi
ISSUE 3:
MySQL issue - "error 6003: The value for column 'IsPrimaryKey' in table 'TableDetails' is DBNull." Specified cast is not valid.
[1 Jan 2016 15:27] "Noman Khan. Run the following command on the MySQL DB and then try if this works. set global optimizer_switch='derived_merge=off'" (on the user you will use. i.e root)
ISSUE 4:
Out of memory execption. Restart VisualStudio.
ISSUE 5:
If "MySQL" option doesnt display in the "Change Data source" listbox. Install the Visual Studio MySQL Plugin
Can't use a MySQL connection for entity framework 6
NOTE:
EntityFrameworkPowerToolsBeta4 is not built for VS2015 or 17. The installer version must be modified for it to install
How to use Entity Framework Power Tools in Visual Studio 2015?
http://thedatafarm.com/data-access/installing-ef-power-tools-into-vs2015/
NOTE:
You can view the Generated SQL query by debugging/break on the object prior to deferred execution of the query.
You can Use Aliases to map to other db's
Watch out for poor pluralization rules like "Statu" to "Status"
Check out https://us.visualstudiogallery.msdn.microsoft.com/ee4fcff9-0c4c-4179-afd9-7a2fb90f5838/view/Discussions
This seems to be more configurable and better supported. But only works for MSSQL?

How can I run an Entity Framework 7 migration on a remote database using Powershell?

In a standalone entity framework 7 project (note, not a MVC project with an entity context where the command DNX might be used), how can I run a migration on a remote database using Powershell?
I am currently using Entity Framework 7.0.0-rc1-final with Visual Studio 2015 (14.0.23107.0).
At the moment there is no way you can use pure PowerShell to do this because a utility like migrate.exe does not exist yet and importing the EF PS modules is not possible as they require a Package Manager PowerShell Host.
Here are some ideas how you can update a remote db in EF7:
One thing you could do is use the package manager console commands from within VS as usual to update the remote db. You can create a second context that has the remote db connection string and use the update-database command specifying the context to use. These commands require the following package in EF7:
https://www.nuget.org/packages/EntityFramework.Commands/.
I have done this successfully in a class lib project.
Another solution would be to use DNX commands by creating a DNX project instead of a classic one. DNX projects are not just for web sites, it is just another type of project. Here is a link that shows how to create a console app DNX project:
http://docs.asp.net/en/latest/dnx/console.html.
So with this type of project you can use the provided DNX commands that you seem to be aware of.
I hope this helped. Maybe we can give more help if you describe your situation and your end goal in more detail.
Answer too long as a comment, so adding it here...
Have you looked at this article and the links in the answer?
From that answer
The problem with importing the module into a PowerShell console is that I believe the module expects to run in a context where it has a Visual Studio DTE object available. That environment is the NuGet Package Manager Console. This issue has been brought up before. Check out this blog post and this SO question.
This blog post shows how to write code that does migrations.
What might be helpful for readers of this question is what you have tried, what is not working, and other information that might help solve your problem.

Update in MicrosoftAjax.js is not reflect in my local Visual Studio 2005

I got java script error:
SCRIPT5022: Sys.ArgumentOutOfRangeException: Value must be an integer.
Parameter name: y Actual value was 326.739990234375.
When I testing application in IE 10 browser. I did googling and found this solution from Microsoft Support.
I have modified MicrosoftAjax.js and MicrosoftAjax.debug.js files as per above article.
But After modified the javascriptfiles, when I run the application using Visual Studio 2005, I did not get the updated MicrosoftAjax.js and MicrosoftAjax.debug.js files.
So my question is: How can I get the updated versions of these two javascripts files.
Thanks,
Ankur
Instead of hacking JS files try upgrading your project to a newer .NET framework:
http://codecorner.galanter.net/2013/05/01/solution-for-ie10-error-script5022-sys-argumentoutofrangeexception-value-must-be-an-integer/

TFSBranchToolVsExtension Exection of Action ConnectSourceControl Fails

I downloaded the TFSBranchTool VS Extension Project.
Rebuilt and Installed, but when I try to apply Initial Structure I get the following Error:
Exection Error:
Exection of Action 'ConnectSourceControl' Failed. Details: Could not load file or assembly Microsoft.AlLMRangers.BranchTool.SourceControlWrapper......
Any idea what might be causing the problem ? I tried on 2 different Servers! , I got the latest Update of VS2012.
I got VS2012 SDK installed and Vs2012 ObjectModel too, not sure what I'm missing!
We have posted an update to the sample code on http://vsarguidance.codeplex.com/releases/view/96222, which addresses this bug.
The issue was that Microsoft.ALMRangers.BranchTool.SourceControlWrapper.dll was missed in VSIX package. As action execution engine using MEF to load actions, it has no direct references to actions implementation assembly.
Vladimir from the team fixed the issue by specifying assembly as the MEF asset in the VS extension’s manifest file. Now it’s redistributed inside the extension package.
Can you verify that you have the file Microsoft.ALMRangers.BranchTool.SourceControlWrapper.dll
in the following folder:
%LOCALAPPDATA%\Microsoft\VisualStudio\11.0\Extensions\Microsoft. ALM Rangers\TfsBranchToolVSExtension\1.0
If its not there - try deleting the TfsBranchToolVSExtension and re-install the VSIX.

Problems with zend-tool reporting that providers are not valid

I have recently setup XAMPP 1.7.3 and ZendFramework 1.10.4 on a new computer and many of the commands that I normally use now fail.
Here are the steps I used to setup and test ZF.
First I added the ZF library folder (C:\xampp\php\ZendFramework-1.10.4\library) to the include path in php.ini.
Then I added the ZF bin folder (C:\xampp\php\ZendFramework-1.10.4\bin) to my Path system variable.
To test that everything is configured correctly I ran the command "zf show version" from the command line. The result is "Zend Framework Version: 1.9.6".
Immediately something appears to be wrong. The file that is downloaded is "ZendFramework-1.10.4.zip" and the reported version is 1.9.6. I have re-downloaded the latest version (1.10.4) and removed old copy. Still the incorrect version number problem persisted.
Having done some research there is a bug in the ZF knowledgebase that version 1.10.3 reports a wrong version number. So that may explain the version number problem.
Moving forward I tried to run some zf-tool commands and certain commands reports that the action or provider is not valid.
Example:
C:\xampp\htdocs>zf create project test
Creating project at C:/xampp/htdocs/test
C:\xampp\htdocs>cd test
C:\xampp\htdocs\test>zf create controller Test
Creating a controller at C:\xampp\htdocs\test/application/controllers/TestController.php
...
Updating project profile 'C:\xampp\htdocs\test/.zfproject.xml'
C:\xampp\htdocs\test>zf create action test Test
Creating an action named test inside controller at C:\xampp\htdocs\test/application/controllers/TestController.php
...
Updating project profile 'C:\xampp\htdocs\test/.zfproject.xml'
C:\xampp\htdocs\test>zf enable layout
An Error Has Occurred
Action 'enable' is not a valid action.
...
C:\xampp\htdocs\test>zf create form Test
An Error Has Occurred
Provider 'form' is not a valid provider.
...
Can any one provide insight into these errors and how to correct them?
I had a similar issue, it turned out that I needed to manually update the zf.bat and zf.php files that came included with xampp after updating to the latest zend framework.
I got them from the zend svn here: http://framework.zend.com/svn/framework/standard/trunk/bin/
the simple way if you are using xampp, just go to the path "xampp\php\PEAR" an replace the older Zend directory with all included files by a new one zend 1.10... dir and your porblems are lost :)
i think your problem is, that Zend Tool is shipped with xampp since some versions.
Try to find zf.bat in your Xampp directory and remove it ;)
ZF friends have written the worst kind of docs. For XAMPP user, it is more difficult. I have learning ZF and posting error getting on the path. I am also using XAMPP.
Your error list is very big. I hope I can help you.
Solution for error "An Error Has Occurred
Action 'enable' is not a valid action." is XAMPP's Zend Tool installation. Delete that.
Check here for more details about the solution and other possible errors: http://www.satya-weblog.com/2010/11/zend-framework-creating-layout.html.