Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6936869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:17:25+00:00 2026-05-27T12:17:25+00:00

I have an Add-in project for excel. It works fine on my computer. But

  • 0

I have an Add-in project for excel. It works fine on my computer. But when I install it on a client machine it gives me the error message i mentioned.

  1. I have Published it using project-> properties-> publish.
  2. I have the ‘Enable Just my code’ ticked.
  3. I have cleared the ticks for ‘thrown’ and ‘user-unhandled’ for the ‘file not found exception’
  4. I setup the project on the client with the “setup” file in the “publish” folder in my project folder.
  5. In publish-> prerequisites, I have these items ticked:

    .net framework sp1

    Microsoft .net framework 4

    Microsoft office 2007 primary interop assemblies

    Microsoft visual studio 2010 tools for office runtime

    Windows installer 4.5

  6. I’m using JSON. this is the code for my class:

    [Serializable]
    [JsonObject(MemberSerialization.OptIn)]
    public class documentSchemaRestInfo
    {
        [System.Runtime.Serialization.DataMember]
        [JsonProperty]
        public double id { get; set; }
        [System.Runtime.Serialization.DataMember]
        [JsonProperty]
        public string name { get; set; }
    
        [System.Runtime.Serialization.DataMember]
        [JsonProperty]
        public string description { get; set; }
    
        [System.Runtime.Serialization.DataMember]
        [JsonProperty]
        public string[] fields { get; set; }
    }
    

    //************************************************************

  7. The code that uses the class:

    public List<DocumentField> getSchemaOfGroup(documentGroupPk groupPK)
    {
        List<DocumentField> result = new List<DocumentField>();
        HttpWebRequest request = (HttpWebRequest)WebRequest.
            Create(ProxyFactory.baseAddress+"/services/rest/group/" 
            + groupPK.id + "/schema");
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
    
        StreamReader streamReader = new StreamReader(response.GetResponseStream());
        string responseBody = streamReader.ReadToEnd();
    
        dynamic ds = ((dynamic)JsonConvert.DeserializeObject(responseBody))
            .documentSchemaRestInfo;
        foreach (dynamic f in ds.fields)
        {
            result.Add(new DocumentField(
                f.name.ToString(),f.internalName.ToString(),false));
        }
        return result;
    }
    
  8. The client machine has Excel 2010 installed on it.

  9. This is the line of code throwing the exception:

       excelApp = (Excel.Application) 
       System.Runtime.InteropServices.Marshal.GetActiveObject
       ("Excel.Application");
    
  10. What is weird is that it works when I follow the following steps:
    Run it on the client and get an exception.
    Run it on my own PC (where no exception occurs).
    Press the add-in button on the Excel ribbon I made, on the client machine’s application
    AND THIS TIME I DON’T GET ANY EXCEPTION!!
    I checked it so many times. Every time I follow this order it works fine!

11.
This is the stack trace of the exception

Thanks a lot in advance.

Edit:
12. My application works like this:
The first time user clicks on my button on the ribbon, the login form appears,
and if he is authorized the form he has asked for appears.
The next times just the asked form appears.
and the exception happens JUST the first time clicks.
here is my code for that:
(No exception occurs in the last line,
but that’s not the case with the case with the 7th line)

            1.//If there is no ticket, means we haven't had a successfull login yet.=> 
            2.// We should show the login form instead of groups form.
            3.if (string.IsNullOrEmpty(ProxyFactory.ticket))
            4.{
            5.  okOrCancel = new LoginForm().ShowDialog();
            6.    if (okOrCancel == DialogResult.OK)
            7.        new GroupsForm().ShowDialog();
            8.}
            9.//If the is a ticket, means we have had a successful login.
            10.else 
            11.    new GroupsForm().ShowDialog();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:17:26+00:00Added an answer on May 27, 2026 at 12:17 pm

    It’s wee bit confusing looking just at the code spinets but from the title of the question I can guess that you have a problem with dynamic creation of serialization assembly (security issue or partial trust issue). You can try turning “Generate serialization assembly” in your Addin dll to Off by going to project properties / Build and selecting Off from the list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a new Excel 2010 Add-in project, with VS10. When I run
I have a C# Excel Add-in project MyExcelAddIn that has a public method Foo()
I have a VB.NET project in Visual Studio 2010 for an Excel Add-In. I
I have created an Excel 2007 add-in using Visual Studio 2008 and built-in project
I am developing an application where i will have to add a separate project
I got a Project from my Company without Documentation. Now I have to add
I have own project and i would like add for this class same as
I have a project with two localizations add. English and Spanish. My app has
I have a MVC 4 project and i want to add an assembly to
I have a small Visual studio add-in that walks down active project and insert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.