Interop assembly generates AccessViol​ationExcep​tion
Hi,
I am writing a .Net application that needs to read/write to an FPGA via DMA. To do this I've written some LabVIEW VIs that do the read/write, generated a .net interop assembly and successfully incorportated this into my application. The APIs generated by the LabVIEW builder are
public static void ReadDma32(int Channel, int DataBufferSize, out uint[] Data, out int NumberOfEntriesRead, out int ReadResult);
where the channel parameter identifies which DMA FIFO should be accessed. The ReadDma32 calls block until they have any data to return so it's an asynchronous process. This all works fine until I want to read from two different DMA channels at the same time. I then get a AccessViolationException with the message "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." I assume this is because of some marshalling issue when two different threads call the same method at the same time. I've tried changing the execution settings (reentrant execution) on the ReadDma32 vi but this has no effect.
Does anyone have any suggestion on how to solve this issue? My only idea so far is to remove the channel parameter from the method signature and have separate read/write dma methods for each DMA FIFO defined. Not very elegant.
thanks,
Ralph
public static void WriteDma32(int channel, uint[] data, out int writeResult);
I have created interop dll for labview VI's.
I am using interop dll in .NET environment.
The method signature is
public static void ReconstructRawData(byte COMPort, double[] FlowValuesFullScaleFlow, double[] TemperaturesC, ErrorCluster errorin, byte Gastype, bool ValueFormatrealunitsFalse, out ushort GasDensity, out double[,] RawData, out ushort MaxFlow, out ushort GasID, out ErrorCluster errorout);
I am calling as shown below
byte bComPort = byte.Parse("1");
byte bGasType = byte.Parse("6");
bool blnValueFromatFalse = false;
ushort GasDensity = 0;
double[,] RawData = new double[100, 100];
//double[][] RawData = null;
ushort MaxFlow = 0;
ushort GasID = 0;
ErrorCluster ErrorIn = new ErrorCluster();
double[] dblFlowValue = new double[2];
dblFlowValue[0] = 20;
dblFlowValue[1] = 50;
double[] dblTempValue = new double[2];
dblTempValue[0] = 10;
dblTempValue[2]= 20;
But i am getting memory error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt"
Stack Trace:at System.Runtime.InteropServices.Marshal.ReadInt32(IntPtr ptr, Int32 ofs)
at System.Runtime.InteropServices.Marshal.ReadIntPtr(IntPtr ptr)
at NationalInstruments.LabVIEW.Interop.DataMarshal.MarshalArrayOut(Type arrayType, IntPtr data)
at NationalInstruments.LabVIEW.Interop.DataMarshal.MarshalOutputArray(IntPtr entryPointDataSpace, Type arrayType, Int32 terminalIndex)
Now hot to send RawData(multidimentional array) to an method of interop dll?
I have created interop dll for labview VI's.I am using interop dll in .NET environment
.The method signature is
public static void ReconstructRawData(byte COMPort, double[] FlowValuesFullScaleFlow, double[] TemperaturesC, ErrorCluster errorin, byte Gastype, bool ValueFormatrealunitsFalse, out ushort GasDensity, out double[,] RawData, out ushort MaxFlow, out ushort GasID, out ErrorCluster errorout)
;I am calling as shown below
byte bComPort = byte.Parse("1");
byte bGasType = byte.Parse("6");
bool blnValueFromatFalse = false;
ushort GasDensity = 0;
double[,] RawData = new double[100, 100];
ushort MaxFlow = 0;
ushort GasID = 0;
ErrorCluster ErrorIn = new ErrorCluster();
double[] dblFlowValue = new double[2];dblFlowValue[0] = 20;dblFlowValue[1] = 50;
double[] dblTempValue = new double[2];dblTempValue[0] = 10;dblTempValue[2]= 20;
But i am getting memory error "Attempted to read or write protected memory.This is often an indication that other memory is corrupt"
Stack Trace:
at System.Runtime.InteropServices.Marshal.ReadInt32(IntPtr ptr, Int32 ofs)at System.Runtime.InteropServices.Marshal.ReadIntPtr(IntPtr ptr)at NationalInstruments.LabVIEW.Interop.DataMarshal.MarshalArrayOut(Type arrayType, IntPtr data)at NationalInstruments.LabVIEW.Interop.DataMarshal.MarshalOutputArray(IntPtr entryPointDataSpace, Type arrayType, Int32 terminalIndex)
Now hoW to send RawData(multidimentional array) to an method of interop dll?
Similar Messages
-
A reference was created to embedded interop assembly
Hi
I have several warnings as below;
A reference was created to embedded interop assembly 'Accessibility' because of an indirect reference to that assembly from assembly 'System.Windows.Forms'. Consider changing the 'Embed Interop Types' property on either assembly.
What do I need to do to resolve these?
Thanks
RegardsHi Y a h y a,
>>A reference was created to embedded interop assembly 'Accessibility' because of an indirect reference to that assembly from assembly 'System.Windows.Forms'. Consider changing the 'Embed Interop Types' property on either assembly.
Could you tell us the real project you were developing, WinForm or others? When did you get this error message?
Based on the error message, you would check whether it is related to the
Embed Interop Types property.
Reference:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/ee5b0fdf-da01-499b-862b-c50ef914c35f/warning-a-reference-was-created-to-embedded-interop-assembly-stdole?forum=visualstudiogeneral
https://social.msdn.microsoft.com/Forums/vstudio/en-US/139194b1-059b-47c6-b079-705b39e3f888/a-reference-was-created-to-embedded-interop-assembly?forum=clr
Best Regards,
Jack
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Warning "A reference was created to embedded interop assembly 'stdole'"
I add Video Cap Active X Control in VB 2010 to display video from my camera IP, but in error list, there is 3warning like this
Warning 1
A reference was created to embedded interop assembly 'stdole' because of an indirect reference to that assembly from assembly 'AxInterop.VIDEOCAPLib'. Consider changing the 'Embed Interop Types' property on either assembly.
Warning 2
A reference was created to embedded interop assembly 'stdole' because of an indirect reference to that assembly from assembly 'Interop.VIDEOCAPLib'. Consider changing the 'Embed Interop Types' property on either assembly.
Warning 3
A reference was created to embedded interop assembly 'stdole' because of an indirect reference to that assembly from assembly 'Microsoft.VisualBasic.Compatibility'. Consider changing the 'Embed Interop Types' property on either assembly.
I 've read this link http://msdn.microsoft.com/en-us/library/ff182188.aspx but i still confuse and I don't know how to fix that case. I hope anyone can help that problems with some example
thank youHi ainunzariah,
You can try set the Embed Interop Types property to false for
AxInterop.VIDEOCAPLib,
Interop.VIDEOCAPLib and Microsoft.VisualBasic.Compatibility
in the References folder to see if it helps.
Thanks.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Can't create interop assembly with images as parameters
Hello,
I'm trying to create an "assembly interop.net " that contains imaq functions. This dll will be called from a c#.net application .
I've managed to do an "assembly interop.net" dll before that takes clusters in parameters, and it worked perfectly. But now when I try to pass images as parameters,
The images is interpreted as a "Refnum" type (I don't know what data type is that ). and when I try to build the dll I got this error message:
L'erreur -2628 s'est produite à : Nœud de méthode dans DatatypeXML_From_Control.vi->AB_ExportedAssemblyVI_Define_VI_Prototype.vi->AB_InteropAssembly.lvclasspen_Top_Level_VIs.vi->AB_Build.lvclass:Build.vi->AB_Application.lvclass:Build.vi->AB_InteropAssembly.lvclass:Build.vi->AB_Build.lvclass:Build_from_Wizard.vi->AB_UI_Frmwk_Build.lvclass:Build.vi->AB_UI_FRAMEWORK.vi->AB_CreateNewWizard_Invoke_CORE.vi->ABUIP_CreateNewWizard_Invoke.vi->ABUIP_CreateNewWizard_Invoke.vi.ProxyCaller
Raisons possibles :
LabVIEW: Une erreur s'est produite lors de l'analyse du document.
Please tell me if you have any idea about this subject.If you need the image data, you need to convert the image to an array. The purple wires in LV are mearly pointers to memory. They do not contain image data in them. Converting the image to an array also insures that a race condition does not inadvertantly alter the image before you have a chance to process, or display it, if some other functions are acting on the image pointed to by the reference.
Machine Vision, Robotics, Embedded Systems, Surveillance
www.movimed.com - Custom Imaging Solutions -
Problems in LV 2010 Appbuilder Interop Assembly Function Editor
There seems to be a bug in the function editor for a dot Net Assembly in the LabVIEW 2010 appbuilder. If you begin adding, removing or rearranging function parameters, the parameter data at the right and function prototype don't match the parameter list.
Ah, I see. I had built a simple adding function and set x+y as the output then deleted x+y parameter and was not seeing anything but then if I deleted one of the input parameters I started to see what I believe you are seeing where the selected parameter would be x in my case but the name and VI input would be y. I will file a Corective Action Report on this. Thanks for pointing this out!
<Brian A | Applications Engineering | National Instruments> -
Hi,
I'm using my own .net application that communicates with NationalInstruments.DaqMx.dll (version 9.7) in order to activate NiDaq in the following configuration:
PXI -1033 chassis with two slots of PXI-6284, measuring differential voltage. This application was already running for some months and was tested under high performance - high sampling rate and long hours, with no problems so far. Recently we were trying a new use case - running short sessions (60 mins each) of measurements in sampling rate = 100 and samples per channel =100. after few iterations we keep getting access violation exception:
Exception Info: System.AccessViolationException
Stack:
at NationalInstruments.DAQmx.Task.UnregisterAsyncWaitHandle(System.Threading.WaitHandle)
at NationalInstruments.DAQmx.Internal.DaqAsyncResult.AsyncOpDone()
at NationalInstruments.DAQmx.Internal.AnalogMultiChannelMemoryOptimizedMultiSampleReadAsyncResult.WorkItem(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Keeping the sampling rate as 100, but setting samples per channel to 1000 seems to solve this problem.
Can someone explain me what is the cause of this exception?
Thanks,
Hadas
Solved!
Go to Solution.Thanks Mike,
I attached the relevant code pieces. Generally, it is based on the example on NI-DAQ\Examples\DotNET4.0\Synchronization\Multi-Device\AIContAcquisition\cs.
It has 4 classes:
SyncTask - an abstract class that represents one task
NiSyncTask - a derived class that does the actual access to DAQmx API
TaskManager - an abstract class that manages several SyncTasks
NiTaskManager - a derived class that manages NiSyncTasks
It's quite complicated, but I hope it will be helpful.
Regards,
Hadas
Attachments:
SynTask.zip 9 KB -
Hi All,
I have problem to convert word document in to html (Office 2007)
Interop Assembly appear to work but powershell returns:
Unable to
find type [Microsoft.Office.Interop.Word.WdSaveFormat]:
I'using :
$saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat], “wdFormatFilteredHTML”);Hi Bill,
Thank for your reply.
I found this usefull script: http://gallery.technet.microsoft.com/office/6f7eee4b-1f42-499e-ae59-1aceb26100de
On W7 + Office 2010 Works fine with no errors
ONLY On W7 + Office 2007 returns "Unable to
find type [Microsoft.Office.Interop.Word.WdSaveFormat]:"
Interop Ass. same to work, only "save format" have potential strange issue.
I don't understand why with Office 2007 only ... -
I got this error when I tried to drop a TestStand Engine class onto my main form in VisualStudio.NET.
Compiler errors occurred when generating a Windows Forms wrapper for ActiveX control 'AxNationalInstruments.TestStand.Interop.API'
The error message went on to say that it saved the source in ./obj/AxInterop.TS.cs so I added that to the project. When I try to build it, I get this error:
The designer must create an instance of type 'System.Windows.Forms.AxHost' but it cannot because the type is declared as abstract.
I am using TestStand 3.0 evaluation, Version 7.1.3088 of Microsoft Development Environment 2003, and .NET Framework 1.1 Version 1.1.4322 SP1.
Is this aximp.exe problem?
Can someone suggest how to fix this?
Thanks,
JeffTestStand installs pre-built interop wrappers for the TestStand engine and all the TestStand UserInterface controls. You can find them in \API\DotNet\Assemblies\CurrentVersion\.
However, the best thing to do is usually to add the ApplicationMgr control to your .NET form and then call form.axApplicationMgr1.GetEngine() to get the engine. Doing this automatically adds references to the interop assemblies to your project. You can find this control in the TestStand tab of your .NET toolbox when you have a form active.
Ideally, you should start with the .NET simple operator interface examples which are in \OperatorInterfaces\NI\Simple\CSharp\ and \OperatorInterfaces\NI\Simple\VB.Net\
- James -
Hi there! We have a proposal template in Excel that, in my code, I export to a JPG and attach to an e-mail. I've been using Excel Interop for this. Since we've upgraded to .NET 4.5 it isn't working. I understand there's been some
changes. I'll admit I don't understand this stuff. I grabbed some code off the internet, modified it and have been using it.
The thing is, the code is working on my development machine, but not on a couple of my test machines once I compile it and deploy. I don't quite know why. The Interop assemblies are on all the machines. Here's my code:
Sub ExportProposalToJPG(ByVal path As String)
'' See if excel is open, if so, need to close
Dim excelCount As Integer = 0
For Each myProcess As Process In System.Diagnostics.Process.GetProcesses
If UCase(Mid$(myProcess.ProcessName, 1, 5)) = "EXCEL" Then
myProcess.Kill()
excelCount += 1
End If
Next
MsgBox(Str(excelCount) + " instances of Excel closed.")
If My.Computer.FileSystem.FileExists(Environ("Temp") & "\proposal.jpg") Then
My.Computer.FileSystem.DeleteFile(Environ("Temp") & "\proposal.jpg")
End If
Dim excel As Microsoft.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
Dim ws As Microsoft.Office.Interop.Excel.Worksheet
Dim MyChart As Microsoft.Office.Interop.Excel.Chart
Dim objPict As Object
Dim RgCopy As Microsoft.Office.Interop.Excel.Range
Try
excel = New Microsoft.Office.Interop.Excel.Application
excel.DisplayAlerts = False
Dim myFilename As String
myFilename = System.IO.Path.GetDirectoryName(path) & "\" & "~$" & System.IO.Path.GetFileName(path)
If My.Computer.FileSystem.FileExists(myFilename) Then
My.Computer.FileSystem.DeleteFile(myFilename)
End If
wb = excel.Workbooks.Open(path, 2, True)
'' CHANGE THIS BACK TO FALSE!!!
excel.Visible = False
wb.Activate()
ws = wb.ActiveSheet
'RgCopy = Application.InputBox("Select the range to copy / Saveas", "Selection Save", Selection.Address, Type:=8)
RgCopy = excel.Range("A1", "K63")
RgCopy.CopyPicture(XlPictureAppearance.xlScreen, XlCopyPictureFormat.xlBitmap)
excel.ActiveSheet.PasteSpecial(Format:="Bitmap")
objPict = excel.Selection
With objPict
.CopyPicture(1, 1) ':=1
MyChart = excel.ActiveSheet.ChartObjects.Add(1, 1, .Width + 8, .Height + 8).Chart
MyChart.SetSourceData(RgCopy)
End With
With MyChart
.Paste()
.Export(Environ("Temp") & "\proposal.jpg")
.Parent.Delete()
End With
MyChart = Nothing
wb.Close(False)
MsgBox("Proposal Exported.")
Exit Sub
System.Runtime.InteropServices.Marshal.ReleaseComObject(excel)
RgCopy = Nothing
objPict = Nothing
MyChart = Nothing
ws = Nothing
wb = Nothing
Try
excel.Quit()
Catch
End Try
excel = Nothing
Catch
MsgBox(Err.Description)
End Try
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()
GC.WaitForPendingFinalizers()
End Sub
Here is the error I get:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Microsoft.Office.Interop.Excel.Range.CopyPicture(XlPictureAppearance Appearance, XlCopyPictureFormat Format)
at EwingDataApplication.Utilities.ExportProposalToJPG(String path)
at EwingDataApplication.SendEmail.setPath(String path)
at EwingDataApplication.EditSignWorkOrder.Button8_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)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18444 built by: FX451RTMGDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
EwingDataApplication
Assembly Version: 1.0.0.39
Win32 Version: 1.0.0.39
CodeBase: file:///C:/Users/tewing.EWINGGRAPHICS/AppData/Local/Apps/2.0/XCDV80Z3.63R/6NBNX34M.P4H/ewin..tion_9b22d5a3b42c0366_0001.0000_74bc74471f410f1b/EwingDataApplication.exe
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 11.0.50938.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34238 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34245 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
Ewing
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/tewing.EWINGGRAPHICS/AppData/Local/Apps/2.0/XCDV80Z3.63R/6NBNX34M.P4H/ewin..tion_9b22d5a3b42c0366_0001.0000_74bc74471f410f1b/Ewing.DLL
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
Npgsql
Assembly Version: 2.2.0.0
Win32 Version: 2.2.0
CodeBase: file:///C:/Users/tewing.EWINGGRAPHICS/AppData/Local/Apps/2.0/XCDV80Z3.63R/6NBNX34M.P4H/ewin..tion_9b22d5a3b42c0366_0001.0000_74bc74471f410f1b/Npgsql.DLL
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
Mono.Security
Assembly Version: 4.0.0.0
Win32 Version: 4.0.0.0
CodeBase: file:///C:/Users/tewing.EWINGGRAPHICS/AppData/Local/Apps/2.0/XCDV80Z3.63R/6NBNX34M.P4H/ewin..tion_9b22d5a3b42c0366_0001.0000_74bc74471f410f1b/Mono.Security.DLL
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
Microsoft.Office.Interop.Excel
Assembly Version: 15.0.0.0
Win32 Version: 15.0.4675.1003
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.Office.Interop.Excel/15.0.0.0__71e9bce111e9429c/Microsoft.Office.Interop.Excel.dll
office
Assembly Version: 15.0.0.0
Win32 Version: 15.0.4675.1002
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/office/15.0.0.0__71e9bce111e9429c/office.dll
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Is this enough info to get some help? Am I going in the wrong direction? Is Interop not the way to go on this? I want to save an Excel sheet from my database, export it to an image, and attach it to my work order. This worked before
we upgraded our server.
Thanks!
Dave Sharpe
Ewing GraphicsWithout really looking at the all of the error information apparently your non development machines must be different in some fashion from your development machine if you've installed your app onto your development machine and it works without being run
from Visual Studio.
Just because some .Dlls are on all the machines does not mean they are all the same .Dll's with regard to version or other properties.
Are all the machines x86 or x64? Is the development machine running x86 or x64 Office? Which version of Office? Is that same version of office (x86 or x64) installed on the non development machines?
It's possible that using the references on your development machine to install with your app would resolve issues. To do that see this thread
Line and Rectangle shapes in VS 2013 that provides instruction on how to make your app provide copies of all referenced assemblies so they can be included with the app when it gets installed on a system.
Also see
.Net 4.5 - How the Runtime Locates Assemblies.
And obviously the non development machines have .Net 4.5 installed on them as that is what your app is compiled to.
La vida loca -
Hello experts,
I would like to learn to how to use C# IN teststand,and find an instructio about how build dll in C#.
It said add "NationalInstruments.Teststand.Interop.API" reference in C# references.
However,it can not be found as attached.
Who can help about this,appreciated for your help.
Attachments:
0140710152735.png 127 KB
0140710152735.png 127 KBHey Albert,
The corresponding assembly is in your first screenshot, listed as "TestStand 2013 API Primary Interop Assembly".
Hope it helps, and let us know if you have any more questions about it!
Daniel E.
TestStand Product Support Engineer
National Instruments -
CRVS2010 Beta Embed Interops warning messages?
Does anyone know how to eliminate these warnings? We are developing our project on the VS2010 release using WPF.
Warning 1 A reference was created to embedded interop assembly 'c:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\dotnet\iPoint\CrystalDecisions.Enterprise.Framework.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files\SAP BusinessObjects\Crystal Reports 14.0\dotnet\CrystalDecisions.CrystalReports.Engine.dll'. Consider changing the 'Embed Interop Types' property on either assembly. C:\Documents and Settings\SLevy\My Documents\Projects\PMLS\NI\FMA_Client\FMA_Client\CSC
Warning 2 A reference was created to embedded interop assembly 'c:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\dotnet\iPoint\CrystalDecisions.Enterprise.InfoStore.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files\SAP BusinessObjects\Crystal Reports 14.0\dotnet\CrystalDecisions.CrystalReports.Engine.dll'. Consider changing the 'Embed Interop Types' property on either assembly. C:\Documents and Settings\SLevy\My Documents\Projects\PMLS\NI\FMA_Client\FMA_Client\CSC
Warning 3 A reference was created to embedded interop assembly 'c:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\dotnet\iPoint\CrystalDecisions.Enterprise.Framework.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files\SAP BusinessObjects\Crystal Reports 14.0\dotnet\CrystalDecisions.ReportSource.dll'. Consider changing the 'Embed Interop Types' property on either assembly. C:\Documents and Settings\SLevy\My Documents\Projects\PMLS\NI\FMA_Client\FMA_Client\CSC
Warning 4 A reference was created to embedded interop assembly 'c:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\dotnet\iPoint\CrystalDecisions.Enterprise.InfoStore.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files\SAP BusinessObjects\Crystal Reports 14.0\dotnet\CrystalDecisions.ReportSource.dll'. Consider changing the 'Embed Interop Types' property on either assembly. C:\Documents and Settings\SLevy\My Documents\Projects\PMLS\NI\FMA_Client\FMA_Client\CSCI second that, I have the release version (I think), no version number in the about box...
A reference was created to embedded interop assembly 'c:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\dotnet\iPoint\CrystalDecisions.Enterprise.Framework.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files\SAP BusinessObjects\Crystal Reports 14.0\dotnet\CrystalDecisions.CrystalReports.Engine.dll'. Consider changing the 'Embed Interop Types' property on either assembly. -
SQLCLR "Create Assembly" validation in SQL 2012 vs 2008
Greetings, all.
Could someone describe how the assembly validation steps in SQL 2012 have changed relative to SQL 2008R2?
My understanding thus far is that the .NET 4.0 SQLCLR runtime requirement now precludes the use of mixed-mode assemblies. If a CREATE ASSEMBLY validation failure result includes messages such as the detection of unmanaged pointers, is that indicative of
the cut-and-dried, no-way-around-it discovery of a mixed-mode assembly that can
never be registered in SQL 2012?
I have a third-party assembly which registers and operates normally in SQL 2008R2, but when I try to create the assembly in our SQL 2012 test environment, it fails validation, with mostly "Unexpected type on stack" or "Unmanaged pointer found"
errors. I'm suspecting these errors are why the assembly won't register even though CORFLAGS indicates it is a "Pure IL" assembly (and I realize CORFLAGS can be faked).
Are there any options available? The assembly in question is Oracle.DataAccess.dll, and is part of an assembly that (as one might imagine) collects certain data from Oracle in a SQLCLR method as part of one of our business reporting requirements.
It appears at the moment I may be forced to modify the tool to use the now-deprecated Microsoft Oracle data client, which I am loathe to do for it having been deprecated and much slower than the Oracle-provided version.
If there is no workaround, I would respectfully suggest that the "upgrade advisor" team include this kind of review when inspecting existing databases containing .NET assemblies. If we ultimately cannot register this particular third-party assembly
(which has been part of a working component for several years), it will be a *huge* detriment to our database migration - a far cry from the minor warning about certain geography types provided by the upgrade advisor. It would represent a significant breaking
change for our environment.
Thanks for any information that could be provided.Thanks for your reply.
Yes, you are correct in that SQL Server wants to use only "Pure IL" assemblies rather than mixed-mode assemblies. However, when an attempt is made to register an assembly in the SQLCLR that is "mixed mode" (not pure IL), the Verifier respoinds with "Unverifiable
PE/Native code stub." This is not the error I am receiving with the assembly in question.
SQL2012 and SQL2008R2 do not support the same version of the .NET runtime in the SQLCLR subsystem. The former supports 4.0, while the latter supports 2.0 through 3.5. So it is not possible to create a test case with precisely the conditions you specify -
that is, using the same version of .NET in SQL2012 and SQL2008R2 - unless there is some undocumented startup switch or configuration file modification that can be made of which I am not aware.
The failure mode I am seeing is specifically tied to the reference of unmanaged
code references, eg unmanaged pointers. The 2.x assembly registered an working in SQL2008R2 (and its predecessors) contains multiple references to functions with unmanaged pointers, yet registers and works properly when the assembly is CREATED with PERMISSION_SET
= UNSAFE. I expect the same behavior in SQL 2012 - an assembly with references to things like unmanaged pointers should still verify when PERMISSION_SET = UNSAFE is specified.
This is why I am questioning whether the semantics of PERMISSION_SET = UNSAFE in conjunction with the CREATE ASSEMBLY statement have changed between SQL2008 and SQL2012. To me, it appears that SQL2008R2 and its predecessors verified assemblies via the internal
equivalent of a PEVERIFY /MD when PERMISSION_SET = UNSAFE is used, and PEVERIFY /IL when it is not. In SQL2012, it appears that the equivalent of PEVERIFY /IL is done
regardless of the presence of PERMISSION_SET = UNSAFE. This, to my understanding, is contrary to the whole point of PERMISSION_SET = UNSAFE.
PEVERIFY /IL on the previous version of the assembly generates precisely the same kinds of errors generated by the CLR Verifier in SQL2008
without PERMISSION_SET = UNSAFE. When the latter is specified, the assembly registers and works normally. I contend that the CLR Verifier in SQL2012 is ignoring the PERMISSION_SET = UNSAFE qualifier, and hence my search for more information
about how the semantics of this command may have changed specifically for SQL2012.
IF there is an unsupported/undocumented method of allowing the SQLCLR to support both .NET 4.0 and .NET 2.0, I would be very interested in exploring how to leverage it.
Thank you for your interest. -
BPC 7.5 NW Processing Dimensions Microsoft.Office.Interop.Excell issue
Hi
I've tried all the downloads (service Packs, Interop Files etc) mentioned in all websites and posts to try and fix following error:
"Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel_Application'. This Opperation failed because the Query Interface call on the COM component for the interface with ID '{000208D5-0000-0000-C000-0000000000046}' failed due to the following error: Library not registered.
I get this only when I try to Process a dimension
Please can anyone tell me how to fix this?
We have installed BPC 7.5 NW
I had Office 2010 and could process but my input schedules didn't work 100% on Office 2007 so I had to go back to 2007. And now I can't process in the Admin Client. I've uninstalled and reinstalled Office and BPC 7.5 NW SP07 a few times to try and solve this but no luck.
Thanks
Johan FourieHi,
If you are using excel 2007, you need to install the redistributable primary interop assembly from the below link:
https://websmp230.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3134363332383926
Hope this helps. -
Can I use Interop.Excel in Office 365 web app development
Hi,
I want to develop a app for office 365 web. I know javascript api is available for that purpose but the problem is, it is limited to some functionality only. I want to manipulate excel sheets and ranges so will Interop assembly work ?
ThanksHi Maulik,
>>Can I use Interop.Excel in Office 365 web app development <<
No, the Office PIAs is used to interact with Office Client which developet with COM technology. The Office online is different with Office client, it is an service and exposed with HTML.
>>I know javascript api is available for that purpose but the problem is, it is limited to some functionality only.<<
Did javascript mean JavaScript API for Office? If you have any feedback about apps for Office, you can submit it from link below:
Customer Feedback for the Office Developer Platform
Regards & Fei
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a
href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey. -
VIAssemblyException: Invalid LV Client
I'm working on a proof of concept that involves communicating between a C# application and a LabView-generated .NET interop assembly. I'm able to build the assembly dll and reference it in Visual Studio. However, when I attempt to call the external function a run-time exception is thrown (debug output below).
The exported function takes an input, doubles it, and sets the result value by reference. I am using the evaluation version of LabView 2009 however, I don't think that is the issue as I was able to build a shared library dll using the same VI and that worked. Searches don't yield anything useful about that exception or the message so I'm hoping someone has come across this or knows more about the exception. TIA.
Function prototype:
void Doubler(DBL Input, out DBL Answer)
C#:
double dblInput = 1.0;
double dblOutput = 0.0;
try
LVClassName.Doubler(dblInput, out dblOutput); // Debug output below when this line is called.
Debug:
'ClientApp.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\NationalInstruments.LabVIEW.Interop\1.0.0.0__daeb5dc76be4e32a\NationalInstruments.LabVIEW.Interop.dll'
A first chance exception of type 'NationalInstruments.LabVIEW.Interop.VIAssemblyException' occurred in SwanTargetFilename.dll
'ClientApp.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'
.NET assembly call failed: Invalid LV Client.
'ClientApp.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\NationalInstruments.LabVIEW.Interop\1.0.0.0__daeb5dc76be4e32a\NationalInstruments.LabVIEW.Interop.dll'
A first chance exception of type 'NationalInstruments.LabVIEW.Interop.VIAssemblyException' occurred in myassembly.dll
'ClientApp.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'
Exception message: Invalid LV Client.Having disassembled our labview built assembly, I think im begginning to understand what the issue really is, and why this help doc doesnt work for us.
Our Setup:
We have both LV2009 and LV2010 installed (LV2010 installed the 2010 runtime engine)
Our FPGA and RT Code is built using LV2010
Our .Net assembly is built using LV2009
Our assembly was built using LV2009 because apparently you cant load LV2010 built assembly in LV2010 due to some known issue.
You must therefore build the assembly in LV2009 and then you can load it in LV2010 to test that the assembly code works.
The Problem:
However, because we have the 2010 runtime installed we get this error message when trying to load the asembly from visual studio
We get this error because the LV2009 built assembly has this hardcoded reference to version 9.0 of the runtime in it
LvClient.LVRuntimeInst = New LVRuntime(LvClient.EPointNames, Assembly.GetAssembly(GetType(LvClient)).Location, "9.0")
Thus we get the wrong client error as the LV2009 assembly is looking for Runtime 9.0 and we have 10 installed.
So the issues are the following;
That we cant load a LV2010 built assembly in LV2010 thus negate the use of LV2009 and/or
That the LV2009 built assembly has a hardcoded version 9.0 check in it.
The Solutions:
Now, so that my understanding is correct, since we cant have both runtimes installed on the same machine (i tried and the installer prevents it), for this fix to work we would have to do one of the following;
Remove 2010 (and the runtime) and install 2009 and runtime and use the config file fix or,
Remove 2009 and build the dotnet assembly in 2010 and then not be able to test it, or;
Build the assembly in 2009 for testing and again in 2010 for release and to use this fix.
Are these conclusions correct and what are your plans to resolve the identified issues.
Thanks
Matt
Maybe you are looking for
-
What happened? I can no longer see property changes in the design mode/
I'm not sure what I did to make this change, but previously when I use the property values as opposed to html code to make changes, color, formatting, etc, it could be immediately viewed without out going out to the browser. I would view with browser
-
<u><b>ALE-IDOC Master Data Distribution</b></u> We have a busines requirement to email/notify an agent when an incoming idoc has an error-status. Please let me know how to proceed with this. Thanks in advance!
-
I only want to use Firefox, but for the longest time I've had to keep Chrome as a backup browser because that is the only way I can view my gmail account. I want to view it on Firefox, but a cookies issue won't let me. Every time I go into my privacy
-
My FCP X will not let me cut nor copy a section and paste it any where. What can I do? Also, while trying to do this, it added a reshaoe little red box to my entire 90 minute feature film. How can I get rid of this effect? Have no idea how it can
-
Resend Text Settings question - N8 Belle
Is there a way i can set the resend time for txt? you know when the message failed to send it will automatically send message again after 5mins, but 5 mins is too long., i want it to resend after a minute or so. 5 mins and this resend became so usele