Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




Exception has been thrown by the target of an invocation.

api

The Exeption:


CounterSoft.Gemini.Commons.Rest.GeminiRestException: Exception has been thrown by the target of an invocation. Project Id does not match saved data Id value: 0. bei CounterSoft.Gemini.WebServices.BaseService.ThrowResponseException(WebResponse response) bei CounterSoft.Gemini.WebServices.BaseService.ProcessResponse[T](String url, Object obj, RequestType requestType) bei CounterSoft.Gemini.WebServices.IssuesService.CreateComment(Int32 issueId, IssueCommentEN comment) bei geminiaddin.Form1.createComment() in D:\dev\tools\tools\outlook\geminiaddin\src\geminiaddin\Form1.cs:Zeile 138. bei geminiaddin.Form1.button1_Click(Object sender, EventArgs e) in D:\dev\tools\tools\outlook\geminiaddin\src\geminiaddin\Form1.cs:Zeile 280. bei System.Windows.Forms.Control.OnClick(EventArgs e) bei System.Windows.Forms.Button.OnClick(EventArgs e) bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) bei System.Windows.Forms.Control.WndProc(Message& m) bei System.Windows.Forms.ButtonBase.WndProc(Message& m) bei System.Windows.Forms.Button.WndProc(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


with this code:

IssueCommentEN data = new IssueCommentEN();
        if (checkedListBoxControl1.CheckedItemsCount > 0)
        {
            FileEN f = new FileEN();
            TempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
            if (!Directory.Exists(TempPath)) Directory.CreateDirectory(TempPath);
             Attachment a =mailItem.Attachments.Item(checkedListBoxControl1.GetItemValue(checkedListBoxControl1.CheckedIndices[0]));
                a.SaveAsFile(Path.Combine(TempPath, a.FileName));
                f.FileName = a.FileName;
                f.FileData = StreamFile(Path.Combine(TempPath, a.FileName));

            data.Attachment = f;
        }

        data.IssueID = (int)seTicketID.Value;
        data.Comment = richEditControl1.HtmlText;
        data.Visibility = (int)comboBox4.SelectedValue;
        data.VisibilityMemberType = GeminiConstant.SecurityMemberType.GlobalGroup;
        m_smProxyManager.IssuesService.CreateComment((int)seTicketID.Value, data);
cari
· 1
cari
Replies (6)
helpful
0
not helpful

Please ensure that the ProjectID and UserID properties are both populated for the IssueCommentEN.


Simran
· 1762
Simran
helpful
0
not helpful

Hello,

thank you, ok I edit the code with this two lines:

data.ProjectID = m_smProxyManager.IssuesService.GetIssue((int) seTicketID.Value).ProjectID;
        data.UserID = user.UserID;

But the Execption is the same. I got this Message only if I have a attachment, without a attachment it runs perfect.

Have you any other idea?

Thank you Reiner


cari
· 1
cari
helpful
1
not helpful

Please ensure that the ProjectID and UserID are also populated for the FileEN.


Simran
· 1762
Simran
helpful
0
not helpful

Ok, but the FileEN has no Property for UserID. If I populate the ProjectID in the FileEN I got this Exception:


CounterSoft.Gemini.Commons.Rest.GeminiRestException: Exception has been thrown by the target of an invocation. could not insert: [CounterSoft.Gemini.Commons.Entity.FileEN][SQL: INSERT INTO geminiissueattachments (issueid, projectid, commentid, contenttype, contentlength, thefilename, filecontent) VALUES (?, ?, ?, ?, ?, ?, ?); select SCOPEIDENTITY()] Die INSERT-Anweisung steht in Konflikt mit der FOREIGN KEY-Einschränkung "geminiissueattachmentsissueidfk". Der Konflikt trat in der "GeminiSample"-Datenbank, Tabelle "dbo.geminiissues", column 'issueid' auf. Die Anweisung wurde beendet. bei CounterSoft.Gemini.WebServices.BaseService.ThrowResponseException(WebResponse response) bei CounterSoft.Gemini.WebServices.BaseService.ProcessResponse[T](String url, Object obj, RequestType requestType) bei CounterSoft.Gemini.WebServices.IssuesService.CreateComment(Int32 issueId, IssueCommentEN comment) bei geminiaddin.Form1.createComment() in D:\dev\tools\tools\outlook\geminiaddin\src\geminiaddin\Form1.cs:Zeile 142. bei geminiaddin.Form1.button1_Click(Object sender, EventArgs e) in D:\dev\tools\tools\outlook\geminiaddin\src\geminiaddin\Form1.cs:Zeile 284. bei System.Windows.Forms.Control.OnClick(EventArgs e) bei System.Windows.Forms.Button.OnClick(EventArgs e) bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) bei System.Windows.Forms.Control.WndProc(Message& m) bei System.Windows.Forms.ButtonBase.WndProc(Message& m) bei System.Windows.Forms.Button.WndProc(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



cari
· 1
cari
helpful
1
not helpful
ANSWER

Sorry instead of UserID please make sure IssueID is populated within the FileEN.


Simran
· 1762
Simran
helpful
0
not helpful

Thank you, it run ;-)


cari
· 1
cari