not able to execute crystal report in visual studio 2010 - winforms

I am working on visual studio 2010..windows form application
i am try to create one crystal report.but while executing am getting error like this:
Then I added crdb_adoplus.dll to my refernce.but then also am getting same erro
my Target Frame work is .Net FrameWork 4
while coming to this line:
rpt.SetDataSource(ds.Tables(0))
then I edited crdb_adoplus.dll this property to unblock and clicked apply..after that am getting error:
Could not load file or assembly 'crdb_adoplus.dll' or one of its dependencies. The specified module could not be found.":"crdb_adoplus.dll

my self i resolved this issue ,,i changed my app.config file like this:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

Related

How to make SqLite work in Windows 10 at the publication

There is a classic application where Microsoft is used.Entity Framework Core.Sqlite, trying to publish an application through Windows 10 deployment and throws an exception: DllNotFoundException: Unable to load DLL "e_sqlite3": the specified module could not be found. (Exception from HRESULT: 0x8007007E)
Tried adding e_sqlite3 library to " Windows application packaging Project", in end face with the exception: SQLite Error 14: 'unable to open database file' with EF Core code first
I tried different solutions found on the Internet, but not one I did not fit.
Development environment:
Windows 10, Visual Studio 2017, Microsoft.EntityFrameworkCore.Sqlite 2.2.1.0 and Microsoft.Data.Sqlite 2.2.1.0
Here's how I solved both issues.
The first issue is that the native e_sqlite3.dll files are not copied to the Package project's output. The Package project has MSBuild logic in Microsoft.DesktopBridge.targets that is calling the GetCopyToOutputDirectoryItems target of each of its referenced projects (e.g. a WPF project). Since the e_sqlite3.dll files are being included in the referenced project by way of a NuGet package, the way in which they are being included doesn't cause them to be picked up by the GetCopyToOutputDirectoryItems target. I've worked around this by adding the following code to my WPF project:
<Target Name="IncludeNativeBinariesAsOutput" BeforeTargets="GetCopyToOutputDirectoryItems">
<ItemGroup>
<Content Include="$(OutputPath)\x64\e_sqlite3.dll">
<Link>x64\e_sqlite3.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="$(OutputPath)\x86\e_sqlite3.dll">
<Link>x86\e_sqlite3.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<AssignTargetPath Files="#(Content)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="ContentWithTargetPath" />
</AssignTargetPath>
</Target>
The next issue is with the "unable to open database file" error after the necessary native files are where they need to be. I'm thinking this is because it's trying to create the project in a location that is not supported by a Windows Package project. I've handled this by setting a special value that that SqliteConnection looks for to construct a path for the database file. I just added this line to my App constructor class before doing any database operations.
AppDomain.CurrentDomain.SetData("DataDirectory", ApplicationData.Current.LocalFolder.Path);

WPF Performance Suite throws BadImageFormatException

I need to profile my WPF 4.0 application. When I try to open it in WPF Performance Suite 4.0 (from Windows SDK 7.1) it throws a BadImageFormatException:
It complains about a newer runtime, so I ran corflags on my exe to check the runtime version. It says:
Version : v4.0.30319
CLR Header: 2.5
PE : PE32
CorFlags : 1
ILONLY : 1
32BIT : 0
Signed : 0
What's wrong? Why can't I open this WPF application in the profiler?
UPDATE
Tried JeffRSon's suggestion which produced another exception:
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Microsoft.WpfPerformance.ToolAssembly..ctor(Assembly assembly)
at Microsoft.WpfPerformance.Controls.AddToolDialog.ScanAssembly(String filename)
at Microsoft.WpfPerformance.Controls.AddToolDialog.ScanAssembly()
Create a file called WpfPerf_managed.exe.config in C:\Program Files\Microsoft Windows Performance Toolkit\WPF Performance Suite or wherever WPF Performance Suite is installed with the following content:
<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
This enables side-by-side runtimes in one process.
Restart WPF Performance Suite and load your assembly.

Unable to view designer in VS2010 due to DLL over the network

I am getting the error -
Unable to load the metadata for assembly 'Aurora.UIResources'. This assembly may have been downloaded from the web. See http://go.microsoft.com/fwlink/?LinkId=179545. The following error was encountered during load: Could not load file or assembly 'Aurora.UIResources, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
I am referencing the file over the network and the application will run and work just fine. I just can't seem to see the 'preview' in the designer. I am running Windows 7 Enterprise 64bit.
Does anyone have an idea on how to resolve this?
See this
This seems to work for some people
"Open devenv.exe.config (in C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE on my machine), and add this"
<runtime>
<loadFromRemoteSources enabled="true" />
....
</runtime>

appSettings not being read from machine.config in Vista

I've recently moved up to Vista x64, and suddenly, my machine.config appSettings block isn't being read by any .NET assemblies.
Right after configSections, and before configProtectedData in C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config, I have:
<appSettings>
<add key="foo" value="blah"/>
</appSettings>
<system.runtime.remoting>
<customErrors mode="Off"/>
</system.runtime.remoting>
Had to save it by running Notepad++ as an administrator, because it's locked otherwise, probably for good reasons. Running the following code in SnippetCompiler or VS .NET 2008:
foreach(var s in ConfigurationManager.AppSettings.AllKeys)
{
Console.WriteLine(s);
}
AppSettingsReader asr = new AppSettingsReader();
Console.WriteLine(asr.GetValue("foo", typeof(string)));
writes out no keys and fails with the following exception:
---
The following error occurred while executing the snippet:
System.InvalidOperationException: The key 'foo' does not exist in the appSettings configuration section.
at System.Configuration.AppSettingsReader.GetValue(String key, Type type)
at MyClass.RunSnippet()
at MyClass.Main()
---
The app I write uses machine.config as a fallback for finding out which environment a user should be running in if it can't be found in the app.config, so I'd like to avoid having to rewrite my app to figure out something that should be working the same as it did in 2000 and XP.
Solved it with the following line of code:
ConfigurationManager.OpenMachineConfiguration().FilePath
which returned:
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Config\machine.config
instead of:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
Forgot I'm using 64 bits now. Adding the appSettings section in the proper config file solved the problem.

SQL Server Management Studio won't start

A coworker of mine has this problem, apparently after installing Re#, which seems totally irrelevant. But perhaps it isn't.
Could not load file or assembly "SqlManagerUi, Version=9.0.242.0..." or one of its dependencies. The module was expected to contain an assembly manifest. (mscorlib).
Why is this?
Thanks
I was with a similar problem, i could not open my SQL Server Management Studio.
This steps works for me:
In file C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe.config, erase the item <NgenBind_OptimizeNonGac enabled="1" />.
Example:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- ...snip... -->
<runtime>
<!-- ...snip... -->
<!-- Remove this line (~line 38) -->
<NgenBind_OptimizeNonGac enabled="1" />
<!-- ...snip... -->
</runtime>
<!-- ...snip... -->
</configuration>
I hope this helps.
Reinstalling the .Net framework didn't help me, but these next steps did. I had to completely uninstall and reinsall the shared components, but it's pretty hard to find out how to do that.
Make sure you have the installation media handy. In my case that's the unzipped folder from the downloaded SQLEXPRWT_x64_ENU ed 2014.exe
First, through your Control panel -> Uninstall a program, find 'Microsoft SQL Server 2014 (x64)'.
Right-click and select Uninstall/Change.
When you're presented with a dialog with the options to 'Add', 'Repair' or 'Remove' the product, select the last (don't worry, your SQL Server won't be touched if you follow these steps carefully.
From the initially blank drop-downlist select << Remove shared features only >>
Follow all steps from there, and you are now able to reinstall the shared features.
Management studio requires the .Net framework. Try removing/reinstalling it.
was there any installing/uninstalling of VS involved? Don't get me started on SQL 2005 and VS intall conficts.

Resources