Error WAT200: No default service configuration "ServiceConfiguration.cscfg" could be found in the project - azure

After installing Visual Studio Enterprise 2017 (Version 15.1 (26403.7)) my Azure Cloud Service does no longer build and gives me the 'Error WAT200: No default service configuration "ServiceConfiguration.cscfg" could be found in the project'. Although it still works fine with Visual Studio Enterprise 2015. (The right TargetProfile is also specified...)

I ran into this last night.
It actually happens when you rename Cloud Service configurations away from Cloud and Local.
In my case, I had deleted the Cloud configuration and created a new, differently named one.
By ensuring that the configurations are called Cloud and Local, the Cloud Service projects will build again using "Resharper build", and (most likely) under "Lightweight solution load".
The configurations can be renamed by right-clicking one of the service roles under the Cloud Service node in Solution Explorer, choosing Properties, then opening up the "Service Configuration" dropdown and clicking <Manage...>.
Now, in the resulting dialog, the configurations can be renamed:
The following bug report got me on the right track:
https://youtrack.jetbrains.com/issue/RSRP-450390

The best way is to change the service configuration prefix in ccproj of your project, add yourprojectname.configurationname
Dot is the life saver.
<ServiceConfigurationPrefix>yourproject.ServiceConfiguration</ServiceConfigurationPrefix>
Add these in itemgroup:
<ServiceDefinition Include="yourproject.ServiceDefinition.csdef" />
<ServiceConfiguration Include="yourproject.ServiceConfiguration.cscfg" />
Make sure you have renamed your cscfg files from the folder it resides.
Reload
Bingo. It works.

Ok I found it, after disabling the 'Lightweight Solution Load' (which in VS 2017 u can disable by right click on the Solution and then Disable Lightweight Solution Load), the error disappears and the Cloud Service builds again.

Similar to Rishikesh mentioned, but I added a service config entry
<ServiceConfiguration Include="ServiceConfiguration.cscfg" />
to the ccproj. Then copied a configuration, e.g. Production and named it ServiceConfiguration.cscfg. Then reloaded the project. That got the ReSharper to build, but MORE importantly for me at the moment was to figure out how to the get Azure DevOps pipeline to build the solution with multiple Classic WebRole projects in it. That was failing for the SAME reason.

Related

How to deploy Azure service fabric project on to a remote cluster(Azure)

I have Created a cluster in Azure http://******.######.cloudapp.azure.com:19080
but don't know how to deploy my service fabric project on to it.
Link to application manifest
ApplicationManifest.xml
It's pretty well documented, unless you are getting specific errors, which you then will need to reference to get some worthwhile help
https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-publish-app-remote-cluster
Your first option is to use the powershell commands. You can also right-click your application in visual studio and select "Publish". Make sure you are using the correct publish profile.
Within Visual Studio, navigate to your Publish Profiles folder under the application and copy/paste the existing cloud.xml file and then rename appropriately. Ensure that you use the correct public facing I.P for your cluster, which will most likely be the load balancer.
The line should look like the following.
<ClusterConnectionParameters ConnectionEndpoint="<YOUR IP>:19000" />
Example:
<ClusterConnectionParameters ConnectionEndpoint="151.41.35.35:19000" />
However, if the cluster is secured you may need additional information. These options are shown within the commented Cluster Connection Parameters of the cloud.xml file.
Right click on the application, select publish and ensure the new publish profile is selected. Visual studio will attempt to validate the connection. Try to publish and keep an eye on the output window for insight in to the process.

VSO not deploying Azure website with WebJob

A website with webjob not deploying to Azure.
I am having an issue getting a website with an associated webjob console application to deploy using continuous deployment via Visual Studio Online. I am using VS2013 with update 4 and latest Azure SDK.
The website, and the associated webjob, will publish to Azure using direct publish for Visual Studio and works perfectly, so I am confident the publish settings are fine.
The solution will build and work locally fine.
The solution, once checked in, will build and (seemingly) deploy fine in VSO (using CI) and Azure notes the build was successful and shows it as 'Active deployment'.
However, the website and associated webjob will not be updated.
When I have browsed the deployed files after the VSO build and deploy on Azure, all that is happening, is the binaries of the console app are being copied into the bin/ folder of the website.
None of the website files are being updated. It is almost as if it is deploying the wrong project!
If I remove the Webjob and just deploy the website, it will build and deploy fine through VSO - the website will update.
It is adding the webjob that causes some issue with the deployment via VSO.
I am confident all steps are correct to add the webjob to the WebApp, with the correct webjobs-list.json being added to the webapp and webjob-publish-settings.json to the Console app - as I said, publishing the website (with the webjob) direct to Azure works perfectly, and both the site and webjob get updated.
I have searched post after post and tried all manner of things, but none have worked.
Given the fact this published fine direct from VS, and also that the build is completing, it would suggest that something is wrong with the VSO Build Defintion.
My first guess would be to change it from building the solution to instead building the web project only, but this does not seem to work.
I have also tried every Output location setting (both for the solution build and the web project build) - the only one that works and the build completes is the solution (.sln) build with 'SingleFolder' set.
I have been battling this for a couple of days now an I'm a bit stumped!
This also happens if you have a static website being deployed using a Visual Studio solution via VSO with an automated build - unless the Visual Studio project / solution containing the website is changed then the actual site contents will not be redeployed.
I think your hunch that it's deploying the wrong project is correct. If you have multiple "deployable" projects in your solution (and the console app is considered deployable, as this is one way you can host/deploy a webjob), you need to tell Kudu which one to deploy.
You can control it adding a new setting under "app settings" on the "configure" tab for the webapp.
The setting you want is Project and it's a relative path from the solution root to the .csproj file of your web project.
Alternatively, you can specify the setting in a custom .deployment file.
Relevant Kudu documentation here
From the documentation:
You can specify the full path to the project file. Note that this is not a path to the solution file (.sln), but to the project file (.csproj/.vbproj). The reason for this is that Kudu only builds the minimal dependency tree for this project, and avoids building unrelated projects in the solution that are not needed by the web project.
Here is an example:
[config]
project = WebProject/WebProject.csproj
I have also tried every Output location setting (both for the solution build and the web project build) - the only one that works and the build completes is the solution (.sln) build with 'SingleFolder' set
That's the root case of problem.
You can't have SingleFolder as it sets the OutDir which mess up with web job packaging.
I had to introduce a wpp.targets files in each of my web app project to create the publish package to a particular path (using PackageLocation)
So, let each project have that and set the setting to AsConfigured (or Per Project) instead of SingleFolder.
See this

object reference not set to an instance of an object error coming when deployin to cloud

Locally the project works perfectly.
It is executing and there are proper entries in database.
But when I am deploying it to cloud at staging it is giving me this error as object reference not set to an instance.
My project requires 2 instances of each web and worker role but since I have a limited edition to free instances I am using only 2. one each. Can that be a problem ?
I am using SDK 1.8
It is ASP.Net project.
Can anyone suggest me how to resolve this issue ?
I had a similar issue where I was getting the following when publishing from Visual Studio 2013 to my Azure Cloud Service with a web role and a worker role. This occurred after upgrading the project from Azure SDK v2.4 to v2.5:
2:41:59 PM - Applying Diagnostics extension.
2:42:01 PM - Object reference not set to an instance of an object.
Even after working with a Microsoft Developer I could not get it to show me any kind of stack trace to indicate where the null was coming from. He just happened to notice something funny in my cloud configuration under the "Roles" folder that looked strange.
The problem was that the diagnostics.wadcfgx is needed for an SDK 2.5 project, whereas before that version the diagnostics.wadcfg is needed. (Note the "x" in the file extension.) Apparently the worker role did not have this file automatically created when the project was upgraded.
In order to fix this particular issue, just right click on the role (in the roles folder under cloud configuration) and select "Add Diagnostic Configuration", then Build the solution and attempt to publish. These diagnostics files are ONLY needed when publishing directly from Visual Studio.
I haved same error today, after upgrading Azure SDK to version 2.5
I'm add configuration diagnostics to each role in service and the error disappeared
Had this with MS Azure Tool 2.9. Turned out that it needed the following in diagnostics.wadcfgx :
<PrivateConfig xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<StorageAccount endpoint="" />
</PrivateConfig>
Hope it helps someone!
I ran into the same issue when upgrading to 2.5. It created the .wadcfgx files and they looked sensible but deployment via Visual Studio would still fail with the same error.
Applying Diagnostics extension.
Object reference not set to an instance of an object.
Package deployment would still work. I was able to get past it via the following steps.
Delete the generated .wadcfgx files
Have Visual Studio regenerate them via the context menu option on the role.
Doing a clean build and redeploying.
I'd love to know what the actual error was and how to get more details. The messaging is pretty terrible.

Azure-Deployment to stage ignores service configuration

I created a cloud service and tested it successfully locally. I added service configurations for stage and production. Here is a snippet of my staging-configuration:
and here my configuration-settings:
Then when I publish I set up the deployment as follows:
All this worked like 2 weeks ago. But now he deploys in VS and when I look into Azure Service Configure area it looks like this:
I played a little bit with the "Update development ..."-checkbox on the second screen but the result is the same.
So it ignores all the settings I made and just won't tranistion my configuration to the ine I named "CloudStage". My current Web PI tells me that I use Windows Azure SDK for .NET (VS 2013) 2.3. I don't get the point.
Edit
Some more things I observed:
No WADLogsTable and WADWindowsEventLogsTable is generated automatically in the staging storage.
I deactivated Remote Desktop because it was one of the changes I made to monitor the event log (which wasn't useful here)
I manually changed the connection strings in Azure Portal but it seems as if the worker is totally unaware of the storage (rebooted it with no success).
Edit
I recognized another thing. Here you can see a running deployment of my service:
See the warning-mark on the left? If I go to my Error list this is shown:
This warning is senseless since it tells me that I did everything the right way. My *.Local.csfg-files are pointing to the local storage. So?!?
This seems weird. Please check the in your ServiceConfiguration.CloudStage.cscfg to verify the expected values.
Have you tried updating any other property like Enabling Remote desktop? Does that get updated on your deployment? You should select the "Deployment Update" check box in the publish dialog. Now, when deploying to an existing Cloud Service, it should ask you if you want to replace it.
If you get the Object reference error every time you right click on project, there might be some issue with the Azure SDK set up.
I'm a little bit further now. What I did was:
Deleted all Services in Azure.
Deleted all Storage Accounts in Azure
Removed my Service-Project completely from solution (not the library containing the worker-logic).
Re-added storage-accounts in Azure.
Re-added services in Azure.
Re-added a project in the solution and added the worker-logic inside it.
Builded up all the publishing-stuff again.
Published it.
The first publish ended like the one described in my question. After I checked the "Update development..."-option in properties of my worker it finally took my transitions into the stage!
Now I recognized, that WADLogsTable was still empty. I hit the instance right in server-explorer and choosse "Update diagnostic settings...". There was an option "Transfer period" suddenly set to "None". This explained to me, why my table was empty and after I set it back to "1" my table is filling again!
Another funny thing beside: When I right-click my Cloud-project in the solution I get "Object reference not set to an instance...". When I just click it left and choose Build->Publish it works.
I just hope that I can help somebody with this. Lets see if it's stable now.
Edit: Yesterday it worked - today is still the same issue :-(.
When you get "Object reference not set to an instance.." for a CloudService project you usually have some kind of mismatch. It could be that a setting in the ServiceConfiguration is not defined in the ServiceDefinition. It could also be that there is a publish profile defined in the .ccproj file for the CloudService that doesn't exist. This might also be what is causing your problems with the different configurations.
So it turns out that the problem is completely on client-side. My Visual Studio (now with SDK 2.4) is doing something wrong. I set up a fresh installation with all the stuff needed :-( and there it works perfect. I'll try to determine if one of my extensions is causing the strange "Object reference not set..."-bug.
Repair-Installation of VS does not solve the problem btw.

AjaxControlToolkit.dll not working on windows azure

Following dlls are not working when I deploy my asp.net application in azure:
1. DropDownCheckBoxes.dll
2. AjaxControlToolkit.dll
They work perfectly in the non-cloud application deployed on the server as well as local.
Any thoughts?
Could you explain why you think these assemblies are not working in Windows Azure? Are you having issues in a web role or in a web site?
Most issues occur because the assembly is not included in the package. Could you try the following for both assemblies:
Right click the assembly
Select Properties
Change Copy Local to True
Redeploy the application.
Checked the "Remove additional files at destination" checkbox when publishing it to Azure and it will work. I had the same problem, none of the other solutions work. Here is the thread I found the solution in also, so simple but who would've known! Also I did not have to uninstall and re-install, all I did is check the checkbox during publishing:
[http://social.msdn.microsoft.com/Forums/windowsazure/en-US/e29cc03b-c822-4ba9-b044-51107c367848/ajaxcontroltoolkit-is-not-working-when-deployed-to-azure?referrer=http://social.msdn.microsoft.com/Forums/windowsazure/en-US/e29cc03b-c822-4ba9-b044-51107c367848/ajaxcontroltoolkit-is-not-working-when-deployed-to-azure?referrer=http://social.msdn.microsoft.com/Forums/windowsazure/en-US/e29cc03b-c822-4ba9-b044-51107c367848/ajaxcontroltoolkit-is-not-working-when-deployed-to-azure][1]

Resources