Run Visual Studio 2013 solution with Crystal Reports - asp.net-mvc-3

I have an MVC application originally developed in VS2010. We have Crystal Reports (CR) integrated into it and all works smoothly.
Now, I need to setup some new workstations which will have only VS2013. I can run the site in VS2013, but only because I have VS2010 and previously installed the CR runtime files. The new stations won't have VS2010 installed and the SAP installer will not run unless VS2010 is on the machine. SAP will not provide a fix until early 2014 at the earliest.
The new workstations don't need to be able to modify the reports, so I don't care if the full CR application is installed, I just need it to be able to reference the runtime files so they can debug other areas of the application.
I cannot remove CR from the application at this time, and cannot install VS2010 on all the new workstations first.
I have tried putting the dlls in the bin folder of the site. I have tried putting them in C:/Windows/Microsoft.NET/
Framework/v4.0.30319/Temporary ASP.NET Files/root/dec0de27/fa4bed84/ Nothing seems to work.
Where do I place the dlls so VS2013 can use them? I know there has to be some way to do this because my workstation can run the site in VS2013 eventhough SAP hasn't released a 2013 version.
Here is the error when they try to run the applicaiton:
Server Error in '/' Application.
Could not load file or assembly 'CrystalDecisions.ReportAppServer.ClientDoc'
or one of its dependencies. An attempt was made to load a program with an
incorrect format.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or
assembly 'CrystalDecisions.ReportAppServer.ClientDoc' or one of its
dependencies. An attempt was made to load a program with an incorrect format.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why
the assembly 'CrystalDecisions.ReportAppServer.ClientDoc' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = CrystalDecisions.ReportAppServer.ClientDoc
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: CrystalDecisions.ReportAppServer.ClientDoc | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is
provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the
assembly,
WRN: that consists of the simple name, version, culture, and public key
token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more
information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/Office/Documents/GIT/Site/site/
LOG: Initial PrivatePath = C:\Users\Office\Documents\GIT\Site\site\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file:
C:\Users\Office\Documents\GIT\Site\site\web.config
LOG: Using host configuration file:
C:\Users\Office\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from
C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/
Framework/v4.0.30319/Temporary ASP.NET Files/root/dec0de27/fa4bed84/
CrystalDecisions.ReportAppServer.ClientDoc.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/
Framework/v4.0.30319/Temporary ASP.NET Files/root/dec0de27/fa4bed84/
CrystalDecisions.ReportAppServer.ClientDoc/
CrystalDecisions.ReportAppServer.ClientDoc.DLL.
LOG: Attempting download of new URL file:///C:/Users/Office/Documents/GIT/
Site/site/bin/CrystalDecisions.ReportAppServer.ClientDoc.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing
terminated.
This is the SAP discussion http://scn.sap.com/message/14614675#14614675

Crystal report is updated support for VS 2013
Updated version document

Probably no longer relevant to you, but CR for VS2013 is now available in support pack 9. Note: You have to run the exe to get integration with VS IDE.
Download from: http://scn.sap.com/docs/DOC-7824

Well, I finally found an answer.
If you install the CR x86 Redist MSI package (for some reason it HAS to be 32bit) it will allow you to run VS2013 without throwing an error. You won't be able to modify the reports, but at least you can build your application.
Download the latest here:
http://scn.sap.com/docs/DOC-7824

Straight from the horse's mouth:
CR for VS 2013 will not be available until early 2014. Please see this thread and the referenced threats in it for more info.

Related

Could not load file or assembly “Oracle.DataAccess” or one of its dependencies

I am trying to run this desktop application with oracle database. I keep getting this error
"Additional information: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.2.0, Culture=neutral, or one of its dependencies. An attempt was made to load a program with an incorrect format".
How can I solve this problem?
FYI: I made the desktop application using .NET with Visual Studio 2015 and an Oracle database.

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.

Microsoft.SqlServer.TransactSql.ScriptDom not found when compiling Visual Studio 13 Lightswitch Project

I have an out of the box Lightswitch project, the only changes are adding a simple table with one string row, changing the project to look for localdb v12, and adding some JS files into the project that are from the aspnetcdn and this is an offline environment.
So, when trying to compile I get this error:
An exception occurred when building the database for the application.
Could not load file or assembly 'Microsoft.SqlServer.TransactSql.ScriptDom,
Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one
of its dependencies. The system cannot find the file specified.
C:\Program Files\(x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v4.5\Microsoft.LightSwitch.targets
My guess is the issue has to do with using LocalDB 12, as the error is for ScriptDom v=11. But how do I verify or change this?
The environment is Windows 08 R2 Server w/ SQL Server 14. Any help is appreciated!
How did you change the solution to look for LocalDb v12? I believe the correct way is by using Tools -> Options -> Database Tools -> Data Connections to change the instance name.

Unit Test Adapter threw exception: Unable to load one or more of the requested types

I am attempting to run SpecFlow tests from the Visual Studio 2010 Command Prompt, and I am getting a rather obtuse error message:
Unit Test Adapter threw exception:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information..
Some info about my VS2010 Project setup:
Windows 7 Enterprise, 64 bit (Version 6.1.7601 Service Pack 1 Build 7601)
Visual Studio 2010 Premium (v10.0.40219.1 SP1Rel)
Using Coded UI Tests
Using SpecFlow 1.9.0, which delegates to the CodedUI test API
MSTest
.NET v4.0.30319
Whole solution is compiling to 32 bit code (I have coworkers using XP still)
I have a post-build event that copies a few DLL files from my NuGet packages directory to the target dir:
copy $(SolutionDir)packages\SpecBind.1.2.1.71\lib\net45\SpecBind.dll $(TargetDir)
copy $(SolutionDir)packages\SpecBind.CodedUI.1.2.1.71\lib\net45\SpecBind.CodedUI.dll $(TargetDir)
Without this, mstest somehow couldn't load a number of SpecFlow assemblies.
Relevant Parts of Test Project's App.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
<section name="specBind" type="SpecBind.Configuration.ConfigurationSectionHandler, SpecBind" />
</configSections>
<connectionStrings>
...
</connectionStrings>
<specFlow>
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
<unitTestProvider name="MsTest" generatorProvider="Specflow.CodedUI.MsTestCodedUiGeneratorProvider, Specflow.CodedUI" runtimeProvider="TechTalk.SpecFlow.UnitTestProvider.MsTest2010RuntimeProvider, TechTalk.SpecFlow" />
<stepAssemblies>
<!-- This attribute is required in order to use StepArgument Transformation as described here;
https://github.com/marcusoftnet/SpecFlow.Assist.Dynamic/wiki/Step-argument-transformations -->
<stepAssembly assembly="SpecFlow.Assist.Dynamic" />
<stepAssembly assembly="SpecBind" />
</stepAssemblies>
</specFlow>
<specBind>
<browserFactory provider="SpecBind.CodedUI.CodedUIBrowserFactory, SpecBind.CodedUI" browserType="IE" />
<!-- For additional details on SpecBind configuration options see the project site. -->
</specBind>
</configuration>
The command I was using to start the tests:
C:\path\to\bin\Debug> mstest /testcontainer:MyTests.dll /test:SpecFlowFeatureName
Loading MyTests.dll
Starting Execution...
Results Top Level Tests
-------- ------------------
Failed ...
Failed ...
Failed ...
...
I've been searching high and low for a solution, and all I keep finding is references to VS2008 and disabling Code Coverage. I have VS2010 and Code Coverage is not enabled in my local test settings.
Windows Event Log Viewer
After rooting around in my Windows Event Log viewer, I finally came across more info (I've heard people complain they can't find a stack trace with this error -- look in your Event Viewer)
The description for Event ID 0 from source VSTTExecution cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
(QTAgent32.exe, PID 6920, Thread 213) Unit Test Adapter threw 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.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.GetAssemblyInfo(Assembly assembly)
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.GetTypeInfo(Type type, Boolean checkAlreadyExaminedType)
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.ResolveMethods()
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.Initialize(UnitTestResult result, UnitTestRunner runner, ConsoleOutputRedirector redirector)
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestRunner.Run(UnitTestElement test, ITestContext testContext, Boolean isLoadTest, Boolean useMultipleCpus)
the message resource is present but the message is not found in the string/message table
I don't know how to resolve this error. SpecFlow tests run fine from inside Visual Studio when I right-click in a .feature file loaded in the editor and choose "Run SpecFlow Scenarios..." but I can't run them from the command line.
Any ideas, or additional information I could post?
As a side note, this stemmed from my earlier question: How do you run SpecFlow scenarios from the command line using MSTest?
Update #1
I did a little more poking around, and found this blog post: MSTest and 64bit. I checked my local test settings, and it is forcing the tests to run in 32 bit.
Now using this command:
mstest /testcontainer:MyTests.dll /testsettings:"..\..\..\Local.testsettings"
Error message:
Test method Blah.Dee.Blah threw exception:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.TestTools.UITest.Extension, Version=11.0.0.0, Culture=neutral, PublicKeyToken=...' or one of its dependencies. The system cannot find the file specified.WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
TestCleanup method Blah.Dee.Blah.ScenarioTearDown threw exception. BoDi.ObjectContainerException: BoDi.ObjectContainerException: Interface cannot be resolved: SpecBind.BrowserSupport.IBrowser.
Update #2
I removed the reference to Microsoft.VisualStudio.TestTools.UITest.Extension and added it back. Cleaned. Rebuilt. Ran the same command again. Still getting the same error.
For some reason it's trying to load the Microsoft.VisualStudio.TestTools.UITest.Extension assembly as Version 11, and I have Version 10 installed on my machine. I'm trying to track down where this version is being specified so I can change it.
Just in case anyone else comes across this, for me it was because code coverage was enabled. Disabling it resolved the issue:
http://blogs.msdn.com/b/danielvl/archive/2010/02/16/enable-code-coverage-in-visual-studio.aspx
Open the .testsettings file
Under "Test Settings", click "Data and Diagnostics"
Uncheck "Code Coverage"
Hit "Apply"
With the help of #jessehouwing's comment above, I've got this fixed. I was running into two problems.
The error I originally referenced was actually caused by mstest attempting to run the tests in a 64bit process (QTAgent.exe). I needed it to run as a 32 bit process because the project was compiled as 32 bit code on my 64 bit Windows 7 machine.
In Visual Studio 2010:
Click the "Test" menu -> "Edit Test Settings" -> "Local (local.testsettings)"
Click "Hosts" in the left hand panel
Make sure "Force tests to run in 32 bit process" is chosen in the "Run tests in 32 bit or 64 bit process" drop down. For me this was the default
In the Visual Studio Command Prompt, run the tests by referencing the local.testsettings file generated by Visual Studio:
mstest /testcontainer:foo.dll /testsettings:"path/to/solution/local.testsettings" /test:SpecFlowFeatureName
The second problem I had was my own fault. Earlier I was playing around with Coded UI tests and SpecFlow and had installed SpecBind, which threw a bunch of settings in App.config for my test project. This NuGet package is only for .NET 4.5, and we use .NET 4.0. I removed that NuGet package and settings from App.config, cleaned and rebuilt. This fixed this issue completely.
So in short, I:
Forced mstest to run in a 32 bit process, and referenced this local.testsettings file from the command line
Removed all references to SpecBind because I got a little NuGet-happy earlier and installed a package incompatible with my .NET runtime.
As you can see by looking at the assembly references required by these packages (I use Reflector for this, but IlSpy or JetBrains' DotPeek will work as well), you'll see that they depend on the v11 version, which is the version that ships with Visual Studio 2012. These can't be used in Visual Studio 2010.
Removing SpecBind will probably help, or finding a version that depends on an older version of CodedUI (you're probably looking for a much older version of SpecBind in this case).
As for your 32-bit issue, you should probably set your project's CPU configuration to AnyCPU, there is normally no need to fix it to x86, unless you're dependent on native methods or if you're referencing other assemblies that are specifically set to use x86 as their target architecture.
This is so troubling.....
I had Test Agent for Visual Studio 2015 installed on my test machine, since we were planning to use it - while on my local machine I had 2013. The tests ran so perfectly with MsBuild on local, that I couldn't understand what could have happened given that I always assumed Microsoft always maintained backward compatability.
MsBuild on test server failed to give any information as to what assemblies were missing (I added Newtonsoft.Json just because it complained initially, but after that I never saw the names of anything else missing). The error message was truncated, stacktrace and debugtrace options never worked...
Once I installed Test Agent for Visual Studio 2013 on the test machine, it ran like a charm.

System.BadImageFormatException: Could not load file or assembly

I have developed a Windows Service application using Visual Studio 2010 in order to integrate two applications.
In my WinService, I call some API DLL files provided by the destination application developer to create some information in the destination application after getting that information from the origin application.
So my windows service works like some middleware application.
When I run the service I get the following error:
System.BadImageFormatException: Could not load file or assembly 'Interop.ErpBS800, Version=8.5.0.0, Culture=neutral, PublicKeyToken=e076e239d0e78a42' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'Interop.ErpBS800, Version=8.5.0.0, Culture=neutral, PublicKeyToken=e076e239d0e78a42'
at MaeilKitWintouch.Primavera.CreateDocument(Facturas fac)
at MaeilKitWintouch.MaeilKitWintouch.ExecuteRequest()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
In my Windows 7 x86 laptop everything works great, but in the Windows Small Business Server 2011 Essentials 64-bit I get that error.
I have PLATFORM TARGET = Any CPU and TARGET FRAMEWORK = .NET 4.
Your application is likely running in 64-bit mode (which is allowed because you set the Platform Target to Any CPU) and trying to load a 32-bit library.
The blog post Compiling .NET for a Specific Target Platform (Any CPU vs x86 vs x64) summarizes it well.
My solution for this error was kind different, after 4 days of 'platform war', if I change to x86/x64 I got the same error....
What I did was:
Unload from visual studio all projects and references to the DLL in conflict (also comment all code lines with references), the project must run without errors.
In the main app, go to properties -> compile -> advance compile options -> Tarjet CPU - and in here change to x86
Re compile project
Load project/refrences to DLL
Test if works fine
Uncomment all code lines and recompile

Resources