Question Status

Verified
AnnabelH asked a question on 6 Mar 2013 4:51 PM

I have a customisation done in VS2012 using C# accessing fields on a modified form. The form was modified using Modifier in GP2013. I added the Dynamics.exe.config reference to my assembly.

However the code is not running in the web client. It works in the full client.

Do I need to add a reference to the Application.Dynamics.ModifiedForms.dll in Dynamics.exe.config? What is the syntax for this?

How do I get a VS Tools addon to run on a modified form in the Web Client?

Reply
Verified Answer
Patrick Roth responded on 6 Mar 2013 8:38 PM

Annabelh,

No, you don't have to add the application assembly to the Dynamics.exe.config.

However for a GP addin on 2013 on the web client, you do have to make sure to add the assembly reference (as you apparently did).

You need to make sure of a few things:

1. the application & vstools assembly is in the GP folder (not the addins folder)

2. Make sure to add your assembly to the the correct section (there are 3 - dynamics, dynutils, web client).

3. Make sure to use proper casing on your class name.  Incorrect casing will cause the call to your assembly to silently fail and you'll wonder what this isn't working.

I know #3 firsthand as I spent over 3 hours trying to make my vstools addin work on web client.  No errors, just didn't work (but the dll was locked by the runtime as i couldn't delete the dll so I _thought_ it was working) and the problem was that my class "GPAddIn" (created by the vstools project template) has a capital "I" in it and I used a lower case "i" in the config file.

patrick

dev support

Reply
AnnabelH responded on 7 Mar 2013 12:41 PM

Thanks for the answer. I had an extra 's' in the assembly name in the config file. So it wasn't even loading. I tried deleting the dll while the web client was running and it worked. So I took another look and found the extra 's'.

I have the addin dll in both the addins folder and the gp2013 folder. For the web client and the full client.

Can I add the addin tag in the config file to the Dynamics tag as well as the DynamicsGPWeb tag and have it load for both the full client and the web client from the main gp 2013 folder only?

Reply
Patrick Roth responded on 7 Mar 2013 1:45 PM

Ah, yours was misspelled in a different spot and so the runtime couldn't even find the assembly to load it.  Being able to delete it as you did proved that out.

Yes, just copy that same line you put in for the web config section to the GP section and it'll load the assembly in both cases from the main GP folder.

You can see this in the GP addins in that all of the web client addins are also in the GP section.

I'm somewhat surprised that we left the \Addins folder and load the assembly from there under the desktop client.  Must be for "legacy" reasons of course but i'm still surprised that we did that and not just removed it.

Reply
AnnabelH responded on 7 Mar 2013 1:49 PM

Thanks. I tried that and it worked. :)

Reply
NenadL responded on 15 Mar 2013 1:48 AM

Hi, I have a same problem, code from .NET work in full client, but don't work in web client.

Annabel, please, do you give me explain how to add the Dynamics.exe.config to my assembly? It's a config file and I can't add by Solution Explorer-References-Add References..

Reply
NenadL responded on 15 Mar 2013 1:50 AM

It is also GP 2013 web client...

Reply
Somakarpagamoorthy Kanagasabapathy responded on 15 Mar 2013 6:09 AM

ANNABELH &  PATRICK,

Please guide me the sample addins line you added in Dynamics.exe.config file.

eg.

<Dynamics>      

   <addin name=" " type='' "/>

</Dynamics>

Thanks

Soma

Note: Please mark it as verified, if this answer your question. Because this will helps to some others who experience the same.

Best Regards,

Somakarpagamoorthy K | GP Techno-Functional Consultant | Dynamics Thoughts

Reply
Patrick Roth responded on 15 Mar 2013 8:42 PM

Soma,

The name can be whatever you like as long as it is unique.

As for the Type, a comment in the dynamics.exe.config file gives guidance on what that should look like right in the config file itself.

And of course there are existing lines for the ones that Microsoft puts into the file.  Of course the MS ones also have information about version, publisher info, etc.  But you really only need to tell it the class name of your addin and then the file name itself.

I don't have 2013 on this machine and so cannot pull up my entry in the config file itself.

But knowing the above and using the GP lines as guidance, you should have the info necessary.

Just note the warnings I added as well as Typo's and capitalizaton (as was my problem) and it should work fine.

Reply
AnnabelH responded on 16 Mar 2013 2:03 PM

There is a word document in the SDK installation folder that gives you a hint to the dynamics.exe.config. Took me a while to notice it even though it is called "Readme".

Basically I created my assembly with the name of <mycompany>.<myteam>.<formtomodify> so that would come out like CompanyA.TeamA.VendorMaintenance.dll when compiled. The class that is generated is the GPAddIn default.

So you need to add this dll to the main GP folder and not the addin folder.

I took a copy of the dynamics.exe.config file to a separate folder so I could keep copies for version control. Also it doesn't like you editing it in place. Once there open it with notepad or notepad++. If you want the addin to work in both full and web client you need to add the <addin /> tag in both the <Dynamics> tag at the bottom of this file and the <DynamicsGPWeb> tag. Note that the end tags for these Dynamics ones are way at the end of the block of text for the Dynamics main files. I just moved the end tag to its own line and added mine above it.

So for my above example the tag to add in BOTH places is:

<addin name="CompanyA.TeamA.VendorMaintenance" type=''CompanyA.TeamA.VendorMaintenance.GPAddIn,CompanyA.TeamA.VendorMaintenance"/>

The name bit at the front is whatever you want it to be. I used the assembly name for my just to keep it unique. The first bit of the type is the fully qualified name including class. The second bit after the comma is the assembly name without the dll file extension.

Hope that helps. Sorry I took so long to reply.

Reply
Somakarpagamoorthy Kanagasabapathy responded on 18 Mar 2013 4:06 AM

ANNABELH &  PATRICK,

Sorry I took so long to reply. Because i tried these in many times but its not working.

My full process:

I have created a new project in GP2013 VSTools. My project name is "vendorTemplate", class name is default "AddIns" and the dll name is "vendorTemplate.dll". In this project i have added a menu "vendorTemplate" in Additional menu of vendor maintenance form using AddMenuHandler() function. Once click this "vendorTemplate" menu the new window will open. That window is created myself in this project.

Now the problem is, In web client once i click that menu the window is not opening. But the project is working fine in client side.

I have added below line in Dynamics.exe.config within three sections(dynamics, dynutils and DynamicsGPWeb).

<addin name="vendorTemplate" type="vendorTemplate.GPAddIn,vendorTemplate"/>.

What is the problem? If i missed any one please help me.

Note: Please mark it as verified, if this answer your question. Because this will helps to some others who experience the same.

Best Regards,

Somakarpagamoorthy K | GP Techno-Functional Consultant | Dynamics Thoughts

Reply
NenadL responded on 18 Mar 2013 8:54 AM

Hi, Annabel you give me a great advice, in VSTDGPReadMe file is explanation.

Thank you very very much. :)

Reply
NenadL responded on 18 Mar 2013 9:01 AM

I have one question more. My .NET based form regularly work in desktop client, but in web client when click in the menu, form will not open. Does anybody has a same problem?

Thanks a lot...

Reply
Patrick Roth responded on 18 Mar 2013 9:16 AM

Nenadl,

It makes searching for and finding answers difficult when there are new Questions asked by the not-original poster.  The original poster & I did respond back as you were having similar issues (with the solution) but really you should have asked your own question in a new thread to not complicate the solution in this post.

But as you now have an entirely new question, this is best asked & answered in a new question and not this one.

Reply
NenadL responded on 18 Mar 2013 12:43 PM

Thanks Patrick, I agree with you, it's my mistake...

Reply
Somakarpagamoorthy Kanagasabapathy responded on 18 Mar 2013 10:06 PM

Thanks ANNABELH &  PATRICK for all the response.

Soma!

Note: Please mark it as verified, if this answer your question. Because this will helps to some others who experience the same.

Best Regards,

Somakarpagamoorthy K | GP Techno-Functional Consultant | Dynamics Thoughts

Reply
Verified Answer
Patrick Roth responded on 6 Mar 2013 8:38 PM

Annabelh,

No, you don't have to add the application assembly to the Dynamics.exe.config.

However for a GP addin on 2013 on the web client, you do have to make sure to add the assembly reference (as you apparently did).

You need to make sure of a few things:

1. the application & vstools assembly is in the GP folder (not the addins folder)

2. Make sure to add your assembly to the the correct section (there are 3 - dynamics, dynutils, web client).

3. Make sure to use proper casing on your class name.  Incorrect casing will cause the call to your assembly to silently fail and you'll wonder what this isn't working.

I know #3 firsthand as I spent over 3 hours trying to make my vstools addin work on web client.  No errors, just didn't work (but the dll was locked by the runtime as i couldn't delete the dll so I _thought_ it was working) and the problem was that my class "GPAddIn" (created by the vstools project template) has a capital "I" in it and I used a lower case "i" in the config file.

patrick

dev support

Reply