Missing file in Sql Server Compact - compact-framework

I am getting an error on the creation of database whenever I am creating a database in my application for WIN CE like this:
private string _dataSource = "DataSource=data.sdf; Max Buffer Size = 512; Max Database Size = 500";
public void CreateDatabase()
{
if (File.Exists("data.sdf"))
{
return;
}
var en = new SqlCeEngine(_dataSource);
en.CreateDatabase();
}
It compiles successfully and when deployed this is the error I get:
System.TypeLoadException: File or assembly name 'System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=3BE235DF1C8D2AD3, or one of its dependencies, was not found.
I have already installed the MS Server Compact. I have searched for an answer and came upon this.
You can either remove the reference if you are not using it or deploy the Sql Server Ce cab files for your particular OS and processor type.
"For only simple develop usage, we just need following CAB to install
it on target device:
sqlce.dev.ENU.ppc.wce5.armv4i.CAB
This CAB is located in the following directory on my machine :-
C:\Program Files\Microsoft SQL Server Compact
Edition\v3.5\Devices\wce500\armv4i
Just copy it to target device and click to install it."
I have gotten to this directory ":\Program Files\Microsoft SQL Server Compact Edition\v3.5 but I do not see the Devices directory and I don't see the armv4i file too.

For all who are in this predicament. Just install the following on your device
sqlce.ppc.wce5.armv4i.CAB
sqlce.repl.ppc.wce5.armv4i.CAB
sqlce.dev.ENU.ppc.wce5.armv4i.CAB
These are all in the SqlCompactServer in the Programs folder of your development machine so long as you've installed the SqlCompactServer 4.0.

Related

how to resolve setup crash issue when launch it?

Am using Windows Server machine 2012 R2 machine to take a setup (exe) and using Wix v3.10.
When i run the burn executable taken from Windows Server 2012 R2 machine in any machine, setup crashed with the error as "System.IO.DirectoryNotFound" not found.
On further investigating this, this exception was occurred during the retrieval of burn and bootstrapper related files(.ba folders from temp location) using WixBundleProviderkey. Because, the .ba folder was existing in some other (some Guild(folder name)} name instead of the required directory in temp location. This issue is occurred only when the setup taken from Windows Server 2012 R2 machine and this is not occurred in some other windows machine if we took setup from it.
Actual path in which .ba folders exists: C:\Users\server\AppData\Local\Temp\2{32DB2298-79D9-4816-9BD6-ABA4271CCA2F}
Application Searching path of .ba folder : C:\Users\server\AppData\Local\Temp\2{36823a7e-b6d2-4db1-b0d1-212cdf7bd669}\
Could anyone please let us know why this issue occurring in Windows server machine?
What is the main function of WixBundleProviderkey?
Below is my code where am facing issue while launching the setup
string baFolder = System.IO.Path.GetTempPath() + SyncBA.Model.Bootstrapper.Engine.StringVariables["WixBundleProviderKey"] + "\";
This is due to the security mitigations added in v3.10.3. That temp folder is no longer created using the bundle's id, it's a random guid. You should get the location of your BA in a different way, such as AppDomain.CurrentDomain.BaseDirectory.

Visual Studio 2015 exception SqlScriptPreprocessSqlVariables when running web publish wizard with update database

Update:
I have reproduced the same Error with a new empty VS2015 WebApplication project.
Added a connectionString to a new empty SQL database
Added a sql-script file to the solution and selected publish... in the publish wizard.
Example of web Publish wizard with included Update script.
I will get the same error building a web deployment package or web deploy .
Original post:
The "SqlScriptPreprocessSqlVariables" task failed unexpectedly. This happens when I use publishing wizard or MSBuild with a profile where the Update Database is selected. On a newly installed machine with only VS2015 Update1 and also on our build server with Team Fondation Server 2015 Build Agent. The same publish profile works in our VS2013 environment.
System.TypeLoadException: Signature of the body and declaration in a method implementation do not match.
Type: 'Microsoft.Web.Publishing.Tasks.SqlScriptPreprocessor.SqlCommandExecuter'.
Assembly: 'Microsoft.Web.Publishing.Tasks, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
at Microsoft.Web.Publishing.Tasks.SqlScriptPreprocessor.SqlScriptPreprocessSqlVariables.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask>d__26.MoveNext()
Here is the same error but from the Build Agent in the new build system. I got the same error runnig XAML build on the new Agent.
##[error]C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Deploy\Microsoft.Web.Publishing.MSDeploy.Common.targets(119,5): Error MSB4018: The "SqlScriptPreprocessSqlVariables" task failed unexpectedly.
##[error]System.TypeLoadException: Signature of the body and declaration in a method implementation do not match. Type: 'Microsoft.Web.Publishing.Tasks.SqlScriptPreprocessor.SqlCommandExecuter'. Assembly: 'Microsoft.Web.Publishing.Tasks, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
##[error] at Microsoft.Web.Publishing.Tasks.SqlScriptPreprocessor.SqlScriptPreprocessSqlVariables.Execute()
##[error] at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
##[error] at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
This is how I fixed the webdeploy packaging problem. This is not a solution I recommend but it works on my machine and on the build server.
Locate the file Microsoft.Web.Publishing.MsDeploy.Common.targets
This is the location on my machine:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Deploy\ Microsoft.Web.Publishing.MsDeploy.Common.targets
On row 117 and forward I commented out the following section.
<!--<SqlScriptPreprocessSqlVariables
UnsupportedKeywords="$(MsdeploySqlUnsupportedCommand)" CheckForUnsupportCommands="$(CheckSqlScriptForUnsupportedCommands)"
TreadSqlScriptUnsupportedCommandsAsWarning="$(TreadSqlScriptUnsupportedCommandsAsWarning)"
SqlScriptFile="%(_DatabasesToPackageForSQL.SourcePath)"
DestinationGroup="%(_DatabasesToPackageForSQL.DestinationGroup)"
ResolveIncludes="$(SqlScriptPreProcessResolveIncludes)"
BatchDelimiter="$(SqlScriptPreProcessBatchDelimiter)"
Condition="$(EnableSqlScriptVariableParameterize) And '%_DatabasesToPackageForSQL.SourcePath)' != '' And Exists('%(_DatabasesToPackageForSQL.SourcePath)') ">
<Output TaskParameter="List" ItemName="_DatabasesToPackage_SqlVariables" />
</SqlScriptPreprocessSqlVariables>-->
I recently faced the same issue and I solved it installing the latest version of "SQL Server Data Tools" and restarting the machine. As #JimAho mentioned, the problem is related to SQL Server Data Tools version installed.
Here you could download it
Don't forget to restart the machine.
Still not quite satisfied with these solutions, I did some research and the least invasive approach I can see is simply registering the assembly in the GAC.
Run VS Command Prompt as Administrator
Hit Windows Start
type "Developer"
Right Click "Developer Command Prompt for VS 2017"
Select Run as Administrator
Run the following command (Replace Enterpise with your installation, e.g. Professional, BuildTools, Community):
gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\SQLCommon\130\Microsoft.SqlServer.BatchParser.dll"

How do I resolve the error ORA-06413: Connection not open?

My local environment VS2012
Using Oracle 10g XE
Dim dbConn As New OleDbConnection
Dim dbComm As OleDbCommand
dbConn.ConnectionString = "Provider=msdaora;Data Source=XE;User ID=scott;Password=tiger"
dbConn.Open()
Tip error: ORA-06413: Connection not open.
Already check the TNSNAMES.ora, SQLNET.ora, LISTENER.ora and its nothing wrong.
But why this error appear?
:(
The error is caused by the parenthesis in the pathname.
possibly you execute VS2012 from C:\program file (x86)...
workaround: create a junction link
steps:
from: command line execute
C:>mkLink /j "Program Files x86" "Program Files (x86)"
and then
fix the (or create a new) shortcut with new path (C:\program file
x86...)
I worked a lot on this problem, I lost a lot of time. Apparently IIS Express in Visual Studio uses the Oracle provider 64 bit.
To solve this problem:
I installed IIS on my PC (Windows 10)
with .NET 4.5 or higher
I compiled the Web API application with 32-bit target.
I publish the web application on my IIS.
On IIS I set enable the apps 32 bit to true
I had the same problem and I resolved the problem installing Oracle 11g Express. Before, I removed all previous Oracle client installation. I use windows 7 64 bit.
Create Bat file to start excel
in bat put path you can adjust to match your folders
start c:\progra~2\micros~1\Office14\Excel.exe
When you start excel just open macro and try :)
I encountered the same problem when working on my Visual studio 2013 project. I was able to run the same project from SVN on a different machine, but it just WON'T work on mine. I checked the connection string and could successfully test the connection in Oracle, but it would throw a disgusting “ORA-06413: Connection not open” error from code.
I got it fixed this way - Install Oracle 11g client -> Select "Administrator" as Type of Installation. Re-open Visual Studio and it worked. Hope it helps!
uninstall your toad or oracle
reinstall on on your window drive ex:(c/d/e) in new folder
don't install in program files (x86)
because program files(x86) is for 32 bit applications
I have resolved the error after the days of searching.
Error Cause:
This error is due to Oracle reserved character "(",")" and in Windows 64 bit there is a folder "Program Files (x86)" which is a creation problem.
Solution:
Create a link folder for "Program Files (x86)" using below command on Window Drive path.
Open cmd as Administrator.
mklink /j "Program Files x86" "Program Files (x86)"
or visit link
download3k article
Open Registry (as Administrator)->Export Registry
Always backup a registry file before changing it. Make a copy of the registry file and work on the copy.
Open Registry file(Copy) in text editor and replace "(x86)" with "x86"
Save the file and import it to your Registry and restart your computer.
Now the "ORA-06413: Connection not open" error goes away.

Application crashes on startup - missing Microsoft.VisualBasic.PowerPacks

I wrote a simple VB.NET application which works fine on the development machine.
However on another machine, even though the .NET Framework is installed, it crashes on startup with System.InvalidOperationException.
There seems to be a problem with it finding the Visual Basic assemblies.
Here is one of the fails (I replaced sensitive information with three dots):
*** Assembly Binder Log Entry (16/06/2013 # 15:45:12) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Users\....
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = ...
LOG: DisplayName = Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Users/......
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MSystemAdmin.exe
Calling assembly : MSystemAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs.DLL.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs/Microsoft.VisualBasic.PowerPacks.Vs.DLL.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs.EXE.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs/Microsoft.VisualBasic.PowerPacks.Vs.EXE.
LOG: All probing URLs attempted and failed.
It isn't that clear why PowerPacks is missing, the .NET 4 Client Profile could be an issue. There have been multiple versions of PowerPacks around and the version numbering got to be a mess. On my machine, that same version is reported as v2.0.50727, even though it is stored in the GAC as version 10.0
Best thing to do is to go back to your project. Click the "Show All Files" icon on the toolbar in the Solution Explorer window. That now shows the References node. Expand it and select the PowerPacks reference. In the Properties window, change the Copy Local property to True.
Rebuild and your build directory now will have a copy of the DLL. Copy it along with the EXE onto the target machine.
Here is the URL to download Microsoft Visual Basic Power Packs 10.0
http://go.microsoft.com/fwlink/?LinkID=145727&clcid=0x804
Apparently, it seems to be a problem with the "PowerPacks"; these are additional controls to the ones given by default in Visual Studio (in the form design part, under "Toolbox"). If you install the required package on the target computer, everything should be fine.
I had this problem in the past and my recommendation is not relying on these elements: they include nice-to-have features (in my case, it was an elliptic shape) but might be replaced with a bit of work and simpler objects. If you want to sell your program to a more or less wide audience, relying on this might become a problem: this package is not installed by default on virtually any computer and thus you would have to ask your clients to go ahead with the installation. Locating these specific controls is straightforward: on the "Toolbox" they should be listed under "PowerPacks" or similar.
After reading the Hans Passant's comment, I do recall that a .dll file has to be put in the same directory than the executable, but I am under the impression that the PowerPacks package from the provided link has to be installed anyway (at least, on computers not having Visual Studio).
I was upgrading Visual Studio from Visual Studio 2013 to Visual Studio 2015 on a new Windows 10 machine. In doing so I copied my Projects folder from a Windows 7 machine to the same path on the Windows 10 machine.
When I opened a project which used MS.VB.PowerPacks.VS I was informed the file could not be found. I downloaded the newest install for MS.VB.PowerPacks.VS Version 12.0.0.0. Visual Studio 2015 blanked out my form pages which used the PrintForm and informed me:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualBasic.PowerPacks.VS, Version 10.0.0.0.
I changed the reference to vcersion 12.0.0.0, but it was still not recognized.
My fix: I copied the the C:\Program Files(x86)\Reference Assemblies\Microsoft\VBPowerPacks\v10.0 folder from my Windows 7 machine to my Windows 10 machine, and then removed the v12.0.0.0 reference and added the v10.0.0.0 reference to the program. I then exited the project and opened it again, and all was well, the forms were displayed in their original beauty.

How can I fix these errors from Visual Studio Express 2012 for Windows Phone?

I am in Visual Studio Express 2012 for Windows Phone, and have followed the MiniBrowser Tutorial located at the following link:
http://msdn.microsoft.com/en-US/library/windowsphone/develop/ff402526(v=vs.105).aspx
After following all the instructions, once I get to "Run Your App" portion of the instructions, under step 1, Build, the following errors are generated:
Error 1 The name "LocalizedStrings" does not exist in the namespace "clr-namespace:MiniBrowser". c:\users\avery_000\documents\visual studio 2012\Projects\MiniBrowser\MiniBrowser\App.xaml 1 1 MiniBrowser
Error 2 The name "LocalizedStrings" does not exist in the namespace "clr-namespace:MiniBrowser". c:\users\avery_000\documents\visual studio 2012\Projects\MiniBrowser\MiniBrowser\App.xaml 10 9 MiniBrowser
Error 3 The build stopped unexpectedly because of an internal failure.
Microsoft.Build.Exceptions.BuildAbortedException: Build was canceled. Failed to successfully launch or connect to a child MSBuild.exe process. Verify that the MSBuild.exe "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" launches successfully, and that it is loading the same microsoft.build.dll that the launching process loaded. If the location seems incorrect, try specifying the correct location in the BuildParameters object, or with the MSBUILD_EXE_PATH environment variable.
at Microsoft.Build.BackEnd.NodeProviderOutOfProc.CreateNode(Int32 nodeId, INodePacketFactory factory, NodeConfiguration configuration)
at Microsoft.Build.BackEnd.NodeManager.AttemptCreateNode(INodeProvider nodeProvider, NodeConfiguration nodeConfiguration)
at Microsoft.Build.BackEnd.NodeManager.CreateNode(NodeConfiguration configuration, NodeAffinity nodeAffinity)
at Microsoft.Build.Execution.BuildManager.PerformSchedulingActions(IEnumerable`1 responses)
at Microsoft.Build.Execution.BuildManager.HandleNewRequest(Int32 node, BuildRequestBlocker blocker)
at Microsoft.Build.Execution.BuildManager.IssueRequestToScheduler(BuildSubmission submission, Boolean allowMainThreadBuild, BuildRequestBlocker blocker) c:\users\avery_000\documents\visual studio 2012\Projects\MiniBrowser\MiniBrowser\MiniBrowser.csproj MiniBrowser
What do these errors mean?
Looks like when Visual Studio Express 2012 for Windows Phone installed on my computer, it put the project folder onto the same hard drive as the application. For some reason, the solution in order to get this to compile, was to recreate the project on a different hard drive, and work from there.
Thanks everyone for your assistance!