Visual Studio 2010 Premium is giving me a "Cannot Create Window" error! - visual-studio

When I first launched the Visual Studio (I just installed it) I choose the default programming layout (Visual C#/Visual Basic.NET/ F#/etc) as Web Development. It gave some error that it couldn't find the layout scheme or something and now it says Cannot Open Window.
Is there some way to reset the selected layout option?

I has the same error when I installs MySql Net Connector mysql-connector-net-6.3.4.msi
I think that this installer corrupt my VS 2010. But NOT.
Previous, I uninstall MySql Connector 6.3.2 and edit machine.config... this was the error!
<system.data>
<DbProviderFactories>
<!-- !!! aƱadido a mano para poderlo usar en VS2010
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net
Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory,
MySql.Data, Version=6.2.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> -->
<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/></DbProviderFactories>
</system.data>
The logic comments not is OK. Then, I erase all commented code and VS2010 come to the live, again!

In my lab the Visual Basic was working fine last semester, but this semester got that "Cannot create the Window" message. After trying reinstalling the VB, Visual Studio, .Net, and other things always got same message. Found a site that mentioned missing windowscodecs.dll file in the windows\system32 directory, but I had the file. Found a different date on file on machines witch the VB was working. Copied the newer windowscodecs.dll file, and that got rid of the problem, but later found I also had to copy the windowscodecsext.dll file as well.
Am now doing a comparison between the two systmes using sigcheck on all the files in system32. Have found a large number that report the Signing date: 12:07 PM 4/14/2008, but the other system has Signing date: 12:13 PM 4/14/2008. Haven't checked the actual contents to see how different the files are. Would be nice if there was a method to check and update to the latest versions.

I've had a similar problem with Visual Studio 2010 Express - restarting the computer solved it.

Similar error message here when starting up a freshly installed VS2010 Premium.
I had copy pasted stuff from old machine.config, but accidentally left out one Section-definition. Fixed by adding the missing definition into configSections-block.

Problem might be due to some issue in machine.config. Try to replace the config with the original and try.
This resolved for me.

Related

What is the ProviderManifestToken value for Oracle.ManagedDataAccess 19.3?

Just installed ODAC for Visual Studio 2017 version 19.3 from here: https://www.oracle.com/database/technologies/dotnet-odacmsi-vs2017-downloads.html to replace ODT for Visual Studio 2017 NuGet Package. Then I noticed my Oracle NuGet packages were gone in my VS solution, and I had to re-add them. But this time I used Oracle.ManagedDataAccess 19.3 (previously had used 12.2.1100), and Oracle.ManagedDataAccess.EntityFramework 19.3 (previously used 12.2.1100).
Now my EDMX gets an error when I try to open it: "Error 168: The provider did not return a ProviderManifest instance. The type initializer for 'OracleInternal.Common.ProviderConfig' threw an exception."
I found an interesting answer by Mitaka here: Entity Framework: The provider did not return a providermanifest instance, so I opened my EDMX with XML Text Editor and found my ProviderManifestToken="12.1". So just for grins, I tried "19.3" and "19.1" but neither worked.
Anybody know the magic value? I'm just hoping that is how to solve the error. Thanks.
Got it. "18.0"
It actually updated itself after I got a bunch of other kinks worked out including "There is a duplicate 'oracle.manageddataaccess.client' section defined." Turns out the definition for Oracle.ManagedDataAccess was in my WebAPI web.config and also the machine config. Had to update THIS specific machine.config:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config - do a search on "managed" and comment out in 3 places.
Then it let me create a connection in Visual Studio 2017 Server Explorer and open the EDMX. Finally the EDMX update wizard is no longer aborting on the Data Connection screen. Back in business.

Could not load file or assembly 'Microsoft.SqlServer.SqlClrProvider

i am creating an C# application in which i am facing error
"Could not load file or assembly 'Microsoft.SqlServer.SqlClrProvider, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The module was expected to contain an assembly manifest.".
i am getting this error while creating ADo.net entitydata model designer from database.
I have installed "SqlSysClrType.msi" for my Sql Server 2014
and "SharedManagementObjects.msi" for my Sql Server 2014, although both were previously installed.
i am running visual studio 2013 ultimate and sql server 2014 developer edition. please help me solve this
I can advice 2 solutions:
Solution #1
Use the following links:
http://blog.waseem-sabjee.com/2013/07/10/how-to-resolve-sqlclrprovider-not-found-without-installing-sql-server-on-the-client-machine-or-needing-a-deployment-project/
http://big.info/2011/12/could-not-load-file-or-assembly.html
If all fails try the following solution:
Solution #2
On your machine where you have SQL Server installed, the "Microsoft.SqlServer.SqlClrProvider.dll" file is in your GAC. However, you cannot access this file without making changes to the registry.
Using the registry editor, go to "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Fusion". Add a new DWORD called DisableCacheViewer. Give it a value of 1.
Once this change is made, you can go to "C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.SqlClrProvider\" to get the dll you need. then add it as a reference in the project.
I hope you've found it helpful.

How can I resolve this error: Loading the include file 'EF.Utility.CS.ttinclude' returned a null or empty string

How can I resolve these errors:
Loading the include file 'EF.Utility.CS.ttinclude' returned a null or empty string.
Value does not fall within the expected range.
Tools Used: VS 2012, Entity Framework 5.0.0, T4MVCExtensions 3.5.0, .NET Framework 4.5
I've been using EF and T4 templates in a project within a large MVC solution without incident. Now, when I right-click on the edmx diagram, EF responds with the message: Value does not fall within the expected range. When I compile the EF project it responds with these messages:
Loading the include file 'EF.Utility.CS.ttinclude' returned a null or empty string. The transformation will not be run. C:\Projects\NSAForms\NSAForms\NSAFormsEDM\NSAFormsEntities.tt
Failed to resolve include text for file:C:\Projects\NSAForms\NSAForms\NSAFormsEDM\EF.Utility.CS.ttinclude C:\Projects\NSAForms\NSAForms\NSAFormsEDM\NSAFormsEntities.tt
Every table in the database has a primary key. I'm struck by how suddenly this issue appeared. Does anyone have some suggestions how to resolve this issue?
Thanks in advance,
Arnold
I had very similar issue and I tried with VS2012 and VS2013.
After reinstalling Entity Framework 6 Tools for Visual Studio 2012
http://www.microsoft.com/en-us/download/confirmation.aspx?id=40762
every thing went back to normal.
In VS 2012, the EF.Utility.CS.ttinclude file will only be installed if the Microsoft Web Developer Tools or Microsoft SQL Server Data Tools component is selected.
Reinstalling Entity Framework 6 Tools for Visual Studio 2012 http://www.microsoft.com/en-us/download/confirmation.aspx?id=40762 work for me
For VS2017, I ended up adding EF6.Utility.CS.ttinclude to model's folder. This resolved my issue with MySql and EF.
File can be found: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF6.Utility.CS.ttinclude
UPDATE To avoid doing the above, removing the entities completely then adding back in fixed the issue.
Had this issue with a recent install of VS2017 Enterprise after already having this functionality working in Professional.
The solution for me was to:
Open the Visual Studio Installer program and "Modify" my Enterprise installation.
Select "ASP.NET and web development" under the Web & Cloud section
Click "Modify" in bottom right
It's probably worth noting that I already had EF6 installed and did not need to re-install it to get this to work.
After completing those steps and firing up Visual Studio, the error went away and I was able to generate my classes successfully. Hope this helps!
Visual Studio 2017
was getting the same error but only in a test project. after reviewing the test project and the other project successfully referencing that file i found that adding the following to the app.config of the failing project resolved my issue
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<connectionStrings>
All of the above solutions did not work for me so I created a new project to see if the problem persists but the error did not occur in the newly created project. I then compared the project with the old backup to check recent changes made and found the problem. I recently had upgraded a package Clarius.TransformOnBuild to more recent version after downgrading the package the error went away.
In my case the issue was caused by a bizarre folder name (with %20 instead of spaces). I just made a directory junction to the same folder with spaces instead of %20 and it solved the issue.
Here is the PowerShell command I used to make the junction:
cd "c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Microsoft\"
mklink /j "Entity Framework Tools" "Entity%20Framework%20Tools"
Junction created for Entity Framework Tools <<===>> Entity%20Framework%20Tools
You can then use ls look at the directory contents, and you should see these two lines (edited for brevity):
Mode LastWriteTime Length Name
---- ------------- ------ ----
...
d----l 2/27/2019 9:57 AM Entity Framework Tools
d----- 2/26/2019 12:24 PM Entity%20Framework%20Tools
...
Under Mode, the l indicates that it is a "link" (aka junction), and the d indicates it's a directory. By making a junction instead of renaming the folder, you can be sure that both directory names will always work.

Using SQL Server CE 4 on a remote host with MVC 3

I just upgraded my host to MVC 3 but I'm trying to do a "hello world" using SQLCE 4.0 but I just got:
Sorry, an error occurred while
processing your request.
I see my layout and everything but instead of data I see that.
On localhost is working as expected
I have:
<add name="PruebaContext" connectionString="Data Source=|DataDirectory|db.sdf" providerName="System.Data.SqlServerCE.4.0"/>
as connectionString.
I put the sdf as part of the project, I added the System.Data.SqlServerCE.dll to the project with the local copy to true.
I have no more ideas. The connString, the dll is in /bin and is working in localhost.
Any ideas?
Thanks.
EDIT
I have some logs now:
Without the "System.Data.SqlServerCE.dll" on /bin:
Unable to find the requested .Net Framework Data Provider. It may not be installed.
System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.
Fine enough. They don't have SqlServerCE4.
With the Dll on local copy, AKA /bin:
Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider of version 8482. Install the correct version of SQL Server Compact. Refer to KB article 974247 for more details.
Exception Details: System.Data.SqlServerCe.SqlCeException: Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider of version 8482. Install the correct version of SQL Server Compact. Refer to KB article 974247 for more details.
The KB says that I need the dll from x86 and amd64. I read somewhere that if I copy two directories to /bin, like: /bin/x86 and /bin/amd64 . I copied that folders from the private folder of SqlServerCE 4 installation folder. Now I got:
Possible file version mismatch detected between ADO.NET Provider and native binaries of SQL Server Compact which could result in an incorrect functionality. This could be due to the presence of multiple instances of SQL Server Compact of different versions or due to wrong binaries with same name as SQL Server Compact binaries. Please install SQL Server Compact binaries of matching version.
Ok. On the root folder of SQLServerCE4 I have some dlls too, so I deleted that two folders and copied that dll to /bin:
Could not load file or assembly 'file:///C:\HostingSpaces\jesusrod\foxandxss.net\wwwroot\mvc3\bin\sqlceca40.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
I think that I tried all things. Scottgu said that SqlServerCE 4 should work on any server without installation.
I don't like to respond to my own answer, but after hours of work I have the answer!
We need:
NuGet (Better than copying the dll's from program file)
With NuGet we install:
EFCodeFirst
SqlServerCompact
EFCodeFirst.SqlServerCompact
The problem was that EF need another dll for SQL CE 4 (System.Data.SqlServerCe.Entity.dll) and we need to put some configuration on web.config:
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0" />
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</DbProviderFactories>
</system.data>
With that, all is working. I have seen like 5 different errors, so we need:
The 2 dll from SQL CE 4, the EF dll, the config in web.config and the native dll (from the package directory where NuGet downloads the library).
It seems that the web.config config is pointing to a concrete version of the SQL CE .dll and the version of the RTM package is different. I can't find the concrete version so I use the .dll from NuGet.
That's all, SQL CE 4 + EF on a remote host.
Just use menu "Project/Add Deployable Dependencies..."
I'm not sure if it is Visual Studio 2010 SP 1 only.
You need to make sure you have the native SQL CE 4.0 dlls in your private application directory (e.g. \bin) in addition to the managed one.
Copy them from "C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0\Private\amd64" (or x86 if you have a 32-bit app).
It may also be wise to deploy the MSVCR90.dll and it's manifest too. Have a look at the documentation in C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0
for more information about the required DLLs and redistribution.
This looks like a problem that's caused by having multiple intermediate bits of data left in a project, where you've replaced included files without cleaning up.
I'd recommend doing a Build->Clean all, followed by making sure that all of your references are to the new, correct DLLs, and then making sure that none of the old files or references are still around anywhere in your project. Attempt to rebuild once that is done.
Since this is a hello world project, it might be easier to just start from scratch with a new project, and include the correct dlls in there.
try installing SQL CE manually.
http://www.microsoft.com/download/en/details.aspx?id=17876
Good Luck.
I was having the same problem. Trying to put a code-first SQL CE 4.0 app into play on my goDaddy account.
I started messing around with various DLL files based upon the thread above and other tutorials, but nothing seemed to work. Something was missing. Then I read about the Add Deployable Dependencies response.
I did that, which created _bin_deployableAssemblies folder. Then I deleted everything from my bin folder except my core project's DLL and copied everything from _bin_deployableAssemblies into the bin folder.
I cleaned out everything in the bin folder on my goDaddy app and resynced the files. That worked. The app loads and if I make codefirst changes to the classes, the dbcontext recreates the database for me. Of course, I don't want that in production, but I wanted to know that everything was working.
I did try using the ASP tutorial about deploying an MVC app to a hosting environment (they use Cytanium hosting as their example), but it didn't work for me on GoDaddy. I had to copy files manually.
Thanks all. This was a huge step for me being able to feel comfortable continuing in MVC and EF.

SQL Compact 4.0 can't open/read sdf file

I've installed SQL Compact 4.0 CTP 2 via WPI and used NUPack to add SQLCE.EntityFramework in my project.
It compiles and run perfectly but I can't open the SDF file in Visual Studio 2010's Server Explorer.
When I try I always receive the following message:
Microsoft Visual Studio
This is not a valid SQL Server Compact Database file or this file version is not supported by current SQL Server Compact Engine.
OK
I've already tried to uninstall and reinstall everything.
It cannot be opened in SQL Server 2008 R2 Management Studio also.
Please help!!
Installing this (Visual Studio 2010 SP1 Tools for SQL Server Compact 4.0) fixed this exact problem for me perfectly:
http://go.microsoft.com/fwlink/?LinkId=212219
Props to ErikEJ from this thread:
http://forums.asp.net/t/1811963.aspx/1
I met the same problem while trying to follow up the tutorials of MVC3 (MvcMovie) provided by asp.net when I was told to double click the "Movies.sdf" file to check out the tables or other infos.
Acturally the solution is just below the request:
Note If you get an error when you double-click Movies.sdf, make sure
you've installed SQL Server Compact 4.0 (runtime + tools support).
(For links to the software, see the list of prerequisites in part 1 of
this tutorial series.) If you install the release now, you'll have to
close and re-open Visual Web Developer.
After Sql Server Compact 4.0(runtime+tools support) installed, the problem is solved.
This question is a bit old. But I think the answer is that VS2010 SP1 has SQLCE 3.5 and SQLCE 3.5 x64 only, and not SQL Compact 4.0. The SQL products come together with Studio. There is still no SQLCE 4.0 today in 2012 included in distribution of Studio 2010 (I use Express edition).
This version packaging is not direct root cause, but just a clue, that different version will need extra effort.
The fix should involve registration of "Data Provider" in .NET Framework used by Visual Studio.
Look at "DbProviderFactories" inside c:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config. This section describes what data providers can be used by .NET and Studio.
If there is unexpected entries there, try to repair framework or register providers manually. To do so, some low level registration tools will be required. Say for asp.net providers there is aspnet_regsql.exe etc. But for just SQLCE itself there must be something similar.
<system.data>
<DbProviderFactories>
<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
</DbProviderFactories>
</system.data>
The difference between broken Studio and working App is that both use the same Framework but have different providers in config. (Or app uses other technique to pick a DLL and open SDF)
Answer: Since SP1 it is officially possible to use SQLCE4.0 in Studio 2010 SP1 (Thanks to Nathan Fisher for link http://support.microsoft.com/kb/983509 )

Resources