سؤال

Forgive me for grasping at straws here. I've bungled a merge in a pretty bad way, and now I'm getting Object reference not set to an instance of an object when I try to build my Worker Role.

I'm pretty sure the problem is here:

enter image description here

I renamed the WorkerRoleWithSBQueue project, but for some reason the 'Worker Role Cloud Project' (not sure what it's really called) is still looking for it under the old name.

I've been picking through all the project files, but I'm having a hard time finding where I need to change this.

What file do I need to change this in?

هل كانت مفيدة؟

المحلول

If you expand the "Roles" node, you'll see the name of the project that your worker role is related.

Here's a sample. I've just created a cloud project with a worker role. As you can see, I didn't set the name.

WindowsAzure2 is my cloud project, WorkerRole1 is my WorkerRole project.

enter image description here

Let's say that I want to rename the worker role project:

enter image description here

Check that under the "Roles" node, there's a "warning" flag. It's because I renamed the worker role project, but the cloud project didn't get this.

If I'll try to compile, I get a error on my "ServiceConfiguration.Local.cscfg" file. Check the node:

  <Role name="WorkerRole1">
    <Instances count="1" />
    <ConfigurationSettings>
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
    </ConfigurationSettings>
  </Role>

It still looking for my "WorkerRole1" project. Just change the Role name, and it will work:

  <Role name="WorkerRoleRenamed">
    <Instances count="1" />
    <ConfigurationSettings>
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
    </ConfigurationSettings>
  </Role>

enter image description here

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top