I have developed a project with Crystal Reports 10 and developed a setup which works fine generating the pdf file but when I install this application in any other machine and try to run pdf generation than I get this exception:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'CrystalDecisions.CrystalReports.Engine, Version=10.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
File name: 'CrystalDecisions.CrystalReports.Engine, Version=10.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304'
at WindowsApplication1.frmPaySlip.ShowReportSalaryStatement(DataSet ds, String toadd, String rep)
at WindowsApplication1.frmPaySlip.pdfgenerator(String rep, String toadd)
at WindowsApplication1.frmPaySlip.btnOK_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
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].
I have tried almost every possibility I found in the net but couldn't get sorted out.
I Sorted out with the issue. The reference of crystal report was referring to the other version of dll so it was working fine in machine and throwing error for other machine. I cleared all the reference and rerefered all the dll `s of crystal report and rebuild the setup its working fine now
Related
I've never dealt with ActiveX controls but I wanted to add one to an an existing MFC project using VS2019. I created a dialog in the resource editor, I added the ActiveX control I wanted to play with (RDP - tried different versions), resized it. Then closed the tab, when I try to open that dialog in the resource editor I get:
---------------------------
Microsoft Visual Studio
---------------------------
The ActiveX control "Microsoft RDP Client Control (redistributable) - version 11" could not be instantiated.
---------------------------
OK
---------------------------
What's wrong and how do I fix it?
Also, what is the difference between the ones that say (redistributable) vs the ones that don't have that?
TIA!!
P.S. After that error above, if I try to open again I get:
An error occurred while initializing the frame's content
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.VisualStudio.Platform.WindowManagement.WindowPaneDocumentObject.Init(Boolean initSize)
at Microsoft.VisualStudio.Platform.WindowManagement.DocumentObjectSite.InitializeDocumentObject(Object punkView)
at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.InitializeDocumentSite(Boolean creatingStubFrame, Boolean replacingStubView, Object punkView, Object punkData, IServiceProvider pServiceProvider, IVsUIHierarchy pUIHierarchy, UInt32 vsid)
at Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.CreateContentPane(FrameMoniker frameMoniker, Boolean isDocument, String lpstrMkDoc, UInt32 eCreateWindowFlags, Object punkView, Object punkData, IServiceProvider pServiceProvider, IVsUIHierarchy pUIHierarchy, UInt32 vsid, Guid rguidCmdUI, ViewGroup parent, IVsWindowFrame& ppWindowFrame)
File Path: Path\To\Resource.rc
Frame GUID: 177559e0-d141-11d0-92df-00a0c9138c45
Frame mode: VSFM_Float
Error Code: 0x80004005
This will be fixed in KB900411
So that error started appearing for no apparent reason.
I looked at these two similar threads with no avail:
The “XamlCTask” task failed unexpectedly in Xamarin
The “XamlCTask” task failed unexpectedly on visual studio for xamarin
My issue seems to be related specifically to the "Tapped" event. I remove all tapped references and the app compiles.
Here are the errors in order:
Severity Code Description Project File Line Suppression State
Error Position 29:44. No property, bindable property, or event found for 'Tapped'
MeetnGreet C:\Users\chris\documents\visual studio 2015\Projects\MeetnGreet\MeetnGreet\MeetnGreet\MeetnGreet.MainPage.xaml 29
Then I do a clean, build and attempt to run....
Severity Code Description Project File Line Suppression State
Error The "XamlCTask" task failed unexpectedly.
System.ArgumentException: An item with the same key has already been added.
Server stack trace:
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add)
at Mono.Cecil.Pdb.PdbReader.PopulateFunctions()
at Mono.Cecil.Pdb.PdbReader.ProcessDebugHeader(ImageDebugDirectory directory, Byte[] header)
at Mono.Cecil.ModuleDefinition.ProcessDebugHeader()
at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader)
at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
at Mono.Cecil.ModuleReader.CreateModuleFrom(Image image, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(Stream stream, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Xamarin.Forms.Build.Tasks.XamlCTask.Compile(IList1 thrownExceptions)
at Xamarin.Forms.Build.Tasks.XamlCTask.Execute()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() MeetnGreet
Along with error....
Severity Code Description Project File Line Suppression State
Error Position 29:44. No property, bindable property, or event found for 'Tapped'
MeetnGreet C:\Users\chris\documents\visual studio 2015\Projects\MeetnGreet\MeetnGreet\MeetnGreet\MeetnGreet.MainPage.xaml 29
Severity Code Description Project File Line Suppression State
Error The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'MeetnGreet, Version=0.0.0.0, Culture=neutral, PublicKeyToken='.
Perhaps it doesn't exist in the Mono for Android profile?
File name: 'MeetnGreet.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.GetAssembly(String fileName)
at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection1 jars, ICollection1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection1 resolvedEnvironments)
at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() MeetnGreet.Android
I think all this translates to is that my forms package is corrupt. However, I am not exactly sure how to go through a clean repair or reinstall using nuget. I have never had to do it before.
Here is what the packages folder for the project looks like for ref. (because of the discussion on the other thread)
Also, disabling the compiler didn't fix the issue (ref the other threads possible solutions)
Any help would be appreciated.
Let me preface this by saying I have only been working with Xamarin for 2 weeks and am still working through some tutorials. That being said, this error is all my fault.
What happened was, I had been using a table view in my working examples and decided to see how grids worked. So I "converted" the tableview cells to entrycells to entry, textcells to labels surrounded by stacked views, etc...
I made an assumption that the Tapped event was everywhere so I never stopped to check if it was available in a stackview for example. I was just moving things around and the intellisense wasn't throwing up any warnings so I assumed everything was ok.
Hence the compiler crash and now the second error of no property makes complete sense now by itself and was not a result of the compiler crashing which is what I had originally thought.
Sorry for sending up a false flag. Seemed like a much larger issue that it was.
I can access the code but can not open the designer view. I can add new items and code them, only the existing item's designer view is returning these errors.
I can also run and debug the program successfully.
The only problem is that now that I have opened it on vs2015, it can not be opened in vs2010 again.
I have been Googling for hours and tried all sorts of things, but still no luck.
Stack trace:
Error HRESULT E_FAIL has been returned from a call to a COM component
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.VisualStudio.LanguageServices.Implementation.Utilities.Exceptions.ThrowEFail()
at Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.CodeTypeRef.LookupTypeSymbol()
at Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.CodeTypeRef.get_TypeKind()
at EnvDTE.CodeTypeRef.get_TypeKind()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.GetUrtTypeFromVsType(CodeTypeRef vsType)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.OnTypePopulateMembers(Object sender, EventArgs e)
at System.CodeDom.CodeTypeDeclaration.get_Members()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.MergedCodeDomParser.CodeTypeDeclarationPopulator.OnPopulateMembers(Object sender, EventArgs e)
at System.CodeDom.CodeTypeDeclaration.get_Members()
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
I've added several iTextSharp DLLs to a Sharepoint 2010 project (deployed as a WebPart).
The Web Part compiles/runs fine (I can step through my WebPart project while interacting with the web part on a page on the Sharepoint site). That is, it runs fine until code is called that actually uses itextsharp.dll. Then, the page crashes, and I get (in the log file), "The system cannot find the file specified"
Do DLLs have to be deployed to a specific place for Sharepoint to find them, or...???
UPDATE
Even after copying four itextsharp DLLs to C:\Windows\Microsoft.NET (Windows Server 2008, .NET 3.5), I get the same err msg.
For the gory details from the log file:
03/30/2015 14:49:28.43 w3wp.exe (0x0968) 0x1834 SharePoint Foundation Runtime tkau Unexpected System.IO.FileNotFoundException: Could not load file or assembly 'itextsharp, Version=5.5.5.0, Culture=neutral, PublicKeyToken=6574839201' or one of its dependencies. The system cannot find the file specified. at XMLToPDF.XMLToPDFWebPart.XMLToPDFWebPart.ConvertFromXMLToPDF(List`1 listOfListItems) at XMLToPDF.XMLToPDFWebPart.XMLToPDFWebPart.btnSave_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ef8cece3-42f4-47d0-ab0a-ca2f0fff46e4
The link provided by user2864740 was key.
In a nutshell, this is what I did:
2-clicked Package.package
Selected the "Advanced" button
Selected the "Add" > "Add Existing Assembly" button
Verified "GlobalAssemblyCache" was selected
Using the ellipsis button affiliated with the "Source Path" edit, added each needed DLL one at a time
Saved Package.package
And: voila! Joy in Mudville, including a ticker-tape parade, a marching band featuring 76 trombones, and the whole nine yards (IOW, it worked).
We're having an issue where trying to open specific designer files within Visual Studio (either 2010 or 2012) will cause it to crash unrecoverably ('Visual Studio has stopped working').
Attaching a debugger to the process when this is attempted throws a System.NullReferenceException, with stack trace:
at System.Windows.Forms.NativeWindow.AddWindowToTable(IntPtr handle, NativeWindow window)
at System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle, Boolean assignUniqueID)
at System.Windows.Forms.Design.ControlDesigner.ChildSubClass..ctor(ControlDesigner designer, IntPtr hwnd)
at System.Windows.Forms.Design.ControlDesigner.HookChildHandles(IntPtr firstChild)
at System.Windows.Forms.Design.ControlDesigner.HookChildControls(Control firstChild)
at System.Windows.Forms.Design.ControlDesigner.HookChildControls(Control firstChild)
at System.Windows.Forms.Design.ControlDesigner.HookChildControls(Control firstChild)
at System.Windows.Forms.Design.ControlDesigner.HookChildControls(Control firstChild)
at System.Windows.Forms.Design.ControlDesigner.OnHandleChange()
at System.Windows.Forms.Design.ControlDesigner.DesignerWindowTarget.OnHandleChange(IntPtr newHandle)
at System.Windows.Forms.Control.ControlNativeWindow.OnHandleChange()
at System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle, Boolean assignUniqueID)
at System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle)
at System.Windows.Forms.NativeWindow.WindowClass.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
This issue appears consistently on the development boxes that we have updated to Windows 8 Enterprise (and now use SSDs). The older boxes on Windows 7 Professional consistently do not exhibit this behaviour. The issue also only seems to occur on specific designer files, though it is not clear yet why.
Does anyone have any suggestions for resolving this, or investigating further?
Never fully resolved this issue, but did engineer a workaround. There is more info (from MS) in the bug report I submitted here:
http://connect.microsoft.com/VisualStudio/feedback/details/802088/designer-file-causing-crash-since-update-to-windows-8
In summary, the MS team suggested this was a "..crash when static initialization for one of the controls was failing"
Through trial and error we narrowed down the issue to identify the control that was causing the issue, and then minimised the initialisation it was performing (but only in design time)
To minimise initialisation we added a property to check if the control was being used in designer:
private bool IsDesignerHosted
{
get
{
if (LicenseManager.UsageMode == LicenseUsageMode.Designtime) return true;
Control ctrl = this;
while (ctrl != null)
{
if ((ctrl.Site != null) && ctrl.Site.DesignMode) return true;
ctrl = ctrl.Parent;
}
return false;
}
}
.. then use this property to prevent activity on the control when in design time.