web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

: error CS0234: The type or namespace name 'Application' does not exist in the namespace 'Microsoft.Dynamics.Ax' (are you missing an assembly reference?) - AX 2012

(0) ShareShare
ReportReport
Posted on by

Developed a custom service for product active date update in AX 2012.  As below. 

DataContract class:

[DataContractAttribute]
class ProductupdateDC
{
ProductId productId;
LiveDate LiveDate;

}

[ DataMemberAttribute('productId')]

public ProductId parmProductId(ProductId _productId= productId)

{

productId =_productId;

return productId;

}

[ DataMemberAttribute('LiveDate')]

public LiveDate parmLiveDate(LiveDate _LiveDate = LiveDate)

{

LiveDate =_LiveDate;

return LiveDate;

}

Service Class:

class ProductupdateService 
{
ProductupdateService productservice ;
}

public void new()
{
;
super();
}

[SysEntryPointAttribute(true),

AifCollectionTypeAttribute('ProductupdateDC', Types::Class)]

public void Update( ProductupdateDC ProductupdateDC)

{
XProductTable xproductTable;
ProductId _productId;
LiveToDate _LiveDate;

_productId = ProductupdateDC.parmProductId();

productTable = xproductTable::find(_productId, true);

{
if(xproductTable)
{
ttsBegin;
xproductTable.LiveDate = ProductupdateDC.parmLiveDate();
xproductTable.update();
ttsCommit;
}
}

}

Created a service and added class. Then deployed service to service group. After generating WSDL - testing with wcfclienttest - getting error - Failed to add a service. Service metadata is not accessible. Make sure your service is running and exposing metadata.  Error Details - : error CS0234: The type or namespace name 'Application' does not exist in the namespace 'Microsoft.Dynamics.Ax' (are you missing an assembly reference?).

 

Need help figuring out issue. 

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    AX 2012

  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    Hi suzi12,

    It's a well-known issue with wcfclienttest, instead of using it try to open Visual Studio and add service reference https://community.dynamics.com/ax/b/axwonders/archive/2012/04/27/creating-a-service-in-ax-2012-consuming-a-service-in-visual-studio-2010

  • Community Member Profile Picture
    on at

    Hi ievgen,

    Thanks for prompt reply. My visual studio skills are not good. Can you show how to write a console code to test my above service in visual studio.

    I created a console application and added service reference. Can you tell me how to proceed further.

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    namespace ConsoleApplication1

    {

       class Program

       {

           static void Main(string[] args)

           {

               servicerefrerence1.productupdateservice c1 = new servicerefrerence1.productupdateservice();

    how to proceed further...

           }

       }

    }

  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    Now you need to create new ProductupdateDC

    servicerefrerence1.ProductupdateDC dc = new servicerefrerence1.ProductupdateDC ();

    //set parameters dc.parmProductId

    and then call Update:

    c1.update(dc);

  • Community Member Profile Picture
    on at

    Thank you. It worked.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans