locked
help me resolve System.TypeInitializationException RRS feed

  • Question

  • hi everybody,

    i get this exception System.TypeInitializationException and i look at the innerException element and i find a System.Runtime.InteropSeervices.SEHException.

    this is the StackTrace element :

       à RoleEnvironmentGetConfigurationSettingValueW(UInt16* , UInt16* , UInt32 , UInt32* )

       à Microsoft.WindowsAzure.ServiceRuntime.Internal.InteropRoleManager.GetConfigurationSetting(String name, String& ret)

       à Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetConfigurationSettingValue(String configurationSettingName)

       à StorageAccount.StorageBase..cctor() dans C:\Users\amal\Documents\Visual Studio 2010\Projects\CloudServicePaymentMarche31MAY\StorageAccount\StorageBase.cs:ligne 44

     

    I think this exception is due to this portion of code :

    static StorageBase()

            {

    CloudStorageAccount storageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("Queue"));

            }

    i am blocked :'(, please help me.


    Thursday, July 14, 2011 8:08 PM

Answers

  • I am not able to download the package as it is not publicly shared.

    But mostly the casue of this issue is that your had mistakenly run the code outside of cloud environment or compute emulator. The way to resolve the issue will be setting the Azure service project as startup project and press F5 to start debugging. We should avoid directly debugging the web role within ASP.NET Development Server instead of compute emulator. Also please avoid using "View in Browser" as it will use ASP.NET Development Server.


    Wenchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    • Marked as answer by Wenchao Zeng Thursday, July 28, 2011 2:53 AM
    Friday, July 22, 2011 6:25 AM

All replies

  • Is this a "unable to load assembly" error? If so, it may be a 32bit vs 64bit conflict. Try changing the target in the project properties.
    Thursday, July 14, 2011 8:50 PM
  • Hi Maloucha,

    I would suggest you please make sure you run the code in either compute emulator or on cloud as I can simulate the same issue by directly running the web project or console application in Visual Studio. Please check and ensure the Azure servcie project is set as startup project.

    Thanks.


    Wenchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Friday, July 15, 2011 2:53 AM
  • Thank you for your replies 

    please BrentDaCodeMonkey, if you could explain further more because i don't find the target in the project properties.

    Saturday, July 16, 2011 6:16 PM
  • hi Wenchao Zeng,

    i have set the cloud service as the statup project but in vain.

    i must tell you that i have a wcf web role and that i try to test it with an asp.net application.

    i think that the exception is triggered because i debug the web role apart after debugging the azure project.

    however, i think the previous step is faithful.

    what do you think?

    Saturday, July 16, 2011 7:09 PM
  • --  i don't find the target in the project properties.

    Right click on the project, and select "Set as StartUp Project"

    Saturday, July 16, 2011 7:36 PM
    Answerer
  • Hi,

    If the issue is still there after settting the Azure service project as startup project as Neil suggested, could you please package a sample project (before packaging, please remove your sensitive information) and share with us by uploading to Windows Live SkyDrive? Also please share the steps you run the project. 

    Thanks.


    Wenchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Monday, July 18, 2011 9:36 AM
  • Hi Wenchao Zeng,

    Thanks for your reply :))))

    i have shared my project and the running steps in SkyDrive and i hope you will help me ;)

    thanks. 

    Wednesday, July 20, 2011 1:44 PM
  • Could you please post the link to your shared file?
    Wenchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Thursday, July 21, 2011 4:55 AM
  •  

    https://skydrive.live.com/redir.aspx?cid=602ee444380b9c23&resid=602EE444380B9C23!105

    Thursday, July 21, 2011 12:27 PM
  • I am not able to download the package as it is not publicly shared.

    But mostly the casue of this issue is that your had mistakenly run the code outside of cloud environment or compute emulator. The way to resolve the issue will be setting the Azure service project as startup project and press F5 to start debugging. We should avoid directly debugging the web role within ASP.NET Development Server instead of compute emulator. Also please avoid using "View in Browser" as it will use ASP.NET Development Server.


    Wenchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    • Marked as answer by Wenchao Zeng Thursday, July 28, 2011 2:53 AM
    Friday, July 22, 2011 6:25 AM
  • Hi,

    I will mark the reply as answer. If you find it no help, please feel free to unmark it and follow up.

    Thanks.


    Wenchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Thursday, July 28, 2011 2:52 AM