.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Using preprocessor directives in Web Services Project

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :ASP.Net
I am writing a web services project in C#/.NET 3.5 / VS 2008. I declare several constants such as: private const string var1 = "hello"; I'd like to change the value of this string when testing, so I put a #TEST directive on top of my .cs file. But I cannot do: if (#TEST) {private const string var1 = "hello test";} else {private const string var1 = "hello";} in the variable declaration. It will not compile. I do not want to change the value in various functions because there are too many functions using the value. Any suggestions?

View Complete Post

More Related Resource Links

Installed Visual Studio 2005 on new laptop - can't open C# web services project solution.

Installed Visual Studio 2005 on new laptop - can't open C# web services project solution - get the 'project not supported by this installation' error. Tried re-installing to no avail. Have run various flavors of devenv as recommended in various posts. Still the same message. I can open the solution fine on my old laptop.    Update: We re-installed service pack 1 for VS and the problem was resolved.

Named Set And Calculated Member within Analysis Services Cube project


Hi there.

I have got the mdx below (titled as MDX In QUERY SsMS) that works fine in SQL Management studio.

I am battling to include it in my Analysis Services project.

Following the logic in the mdx query, I have created the 3 named set and one calculated member (You will see them below), but with no luck.

Please any guidance will do, I desperatly need to include it in my cube



//Get Weeks with sales
[WeeksWithSales] as '
{[Product].[Product Hierarchy].[SKU DESCR]
,([Measures].[SLS R]) >0)}

//the first week
[FirstWeek] as 'HEAD([WeeksWithSales],1)'

[LastWeek] as
[NumWeeks] as 'count([FirstWeek].item(0).item(1):[LastWeek].item(0))'

[NumWeeks] on 0
 (select [Product].[Product Hierarchy].[SKU DESCR].&[BALL BRIDGESTONE 08 E7 +]&[1041597] on 0
 from (select ([FinancialDate].[Financial Calendar].[FINANCIAL MONTH].&[FY2010_MONTH06].parent.parent) on 0
   from [TPSMerch]))

Project Server Services remains in Starting status


When trying to start the Project Server service, the service remains in Starting status.

I've tried to stop and restart the service on the server that I want to run and this doesn't help.

These are the services that I see on the server:

Microsoft Project Server Events Service 2010

Microsoft Project Server Queue Service 2010


I'm on SP2010 14.0.5123.5000 (August CU).

This is preventing me from accessing the service to configure and provision my Project Server site.

How many services does wcf project supports?

You cannot vote on your own post
Hi to  all. I have a small dought. That is How many maximum number of services  does each  WCF Services project  supports? If any body knows then reply?

WCF RIA Services Project Templates Missing


When I start a new project and select Silverlight as the type of project that I want to create, the WCF RIA Services Templates are not there (Silverlight Business Application, WCF Class Library).  They were there before I installed the Silverlight Developer Toolkit.  I've tried uninstalling and reinstalling the RIA Services Tools but to no avail.  I would like to have these templates back.  

I'm attempting to install this set of silverlight developer tools for Visual Studio 2010: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b3deb194-ca86-4fb6-a716-b67c2604a139

 In the directories where the VS 2010 templates are stored, the RIA Services templates are not there.

\%Program Files%\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates\CSharp\Silverlight\1033

\%Program Files%\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache\CSharp\Silverlight\1033

Each folder only has:


Analysis Services Project under VS2008 not honoring Configuration Settings ?

I have a solution with SSRS and SSAS projects in it. Since we have 3 different environments I use VS Configurations for the individual settings. In each of these environments different groups have access to these cubes. However if I deploy the project the roles on the instances are always overwritten by the settings defined in the project. And it seems it is not possible to have different role settings that for each VS configuration. Am I missing something, it should somehow be possible to use the VS configurations to have different permissions per deployment environment?!

Cannot refresh OLAP-based data in Excel Services workbook in browser (SP 2010 / Project Server 2010)



In SharePoint 2010, Project Server 2010, Business Intelligence Center, upon attempting to refresh OLAP data in an Excel chart in the browser, the following error appears:

An error occurred during an attempt to establish a connection to the external data source.  The following connections failed to refresh:

My ODC Connection Name

We have loaded and configured Project Server 2010 according to spec (http://technet.microsoft.com/en-us/library/ee662109.aspx).  Excel Services is configured according to spec (global settings, trusted file locations, trusted data providers and trusted data connection libraries).  The Secure Store Service is configured with the ProjectServerApplication target application. 

Non-OLAP data refreshes of spreadsheet data work fine in the browser.  OLAP data refreshes in the Excel client itself work fine.  Only the OLAP refreshes in the browser fail.  The problem occurs whether using a Microsoft ODC or one that we created (saved in a trusted location).

The ULS log has only one error, which is:

06/21/2010 13:47:17.86  w3wp.exe (0x1238)               &

Project application Services can't start



First,I use windows server 2008 RC0  Enterprise, then I setup sharepoint server 2007 ,finally ,i setup project server 2007,After Run the SharePoint Products and Technologies Configuration Wizard, when I Configure the farm services for Project Server application servers,In the Service list, find Project Application Service. In the same row under the Action column, click Start. but i can't start it.


i think it's because I use windows server 2008 RC0  Enterprise,when i 'm having some trouble starting Excel Calculation Services from the Central Administration page > Operations,i can't start it also. but 

I can start Excel Services on Longhorn (Windows Server 2008) through the following command line:


STSADM.EXE -o provisionservice -action start -servicetype "Microsoft.Office.Excel.Server.ExcelServerSharedWebService, Microsoft.Office.Excel.Server, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c"


how can i use the same way to start Project Application Service<

Installing and Uninstalling Services

Installing and Uninstalling Services.Unlike most projects you create in Visual Studio .NET, Windows Service projects cannot be run directly from the development environment by pressing F5. This is because the service in the project must be installed before the project can run.

You can quickly install your service application by using a command line utility called InstallUtil.exe.

Getting Started with Windows SharePoint Services

Of all of the capabilities of SharePoint, I thought I would start with the most basic installation - as a corporate intranet. It is likely that we will need to discuss some of the elements of SharePoint as we go along, so this also gives us the opportunity to review these elements for future reference.

Before going into too much detail, I would like to point out that you can try the core SharePoint framework (known as Windows SharePoint Services or WSS) for free. On Microsoft's Web site you can download a trial version of Virtual PC 2004 (VPC). Using VPC, you can install the Windows 2003 Evaluation Kit and the WSS add-on. This combination will give you 45 days to evaluate the setup.

Building a Searchable Phone Directory with Windows SharePoint Services

I want to continue to build out the intranet site we've started in our previous articles. A standard item in every intranet is a staff/employee list. Most companies implementing Windows SharePoint Services (WSS) are large enough to have a database that contains all employees. We will use the aggregation features of SharePoint to include data from this database into our intranet.

Project Example: ASP.NET MVC + SubSonic Architecture

use of SubSonic to provide the DAL in association with some ASP.NET MVC sites and was waylaid in my original intent to throw up a post summarizing the architecture we're using for the effort. Well I've finally gotten around to it. Recall that in his fake it till you need it post, Dave provided a window on our architecture that I'll build upon here

Building a 3-Tier App with Silverlight 3, .NET RIA Services, and Azure Table Storage

Silverlight 3, .NET RIA Services, and Windows Azure Services Platform makes a 3-tier Cloud application easier to build: Silverlight 3 as presentation tier, .NET RIA services as the business logic and data access tier, and Windows Azure Table as the data storage tier. The sample application in this article demonstrates the architecture with a simple Survey application with all these technologies working together from Windows Azure.

New Features in Windows SharePoint Services 3.0

Windows SharePoint Services 3.0 (WSS 3.0) is the next version of WSS 2.0, released on 2007, and Microsoft Office SharePoint Server 2007 (MOSS 2007) is built on top of this. Windows SharePoint Services 3.0 takes full advantage of Microsoft ASP.NET 2.0 and the core Microsoft .NET 2.0 runtime. WSS 3.0 offers a lot of new features and programmability support. I have consolidated a list of new features and enhancements in the below section:

Returning a DataSet From a Web Services: Step-by-Step

This Example Shows how to create a webservice which returns a DataSet and a Client Which displays the DataSet in a Grid.


This Example Shows how to create a webservice which returns a DataSet and a Client Which displays the DataSet in a Grid.

.NET Web Services Tutorial

Visual Studio .NET makes .NET programming simple and accelerates the development process. It hides a lot of repetitive and configuration details from the user and improves productivity. However, sometimes you would like to program for .NET without using VS .NET; for example, you want to learn .NET framework programming and do not have access to VS .NET or you want to know what is actually going on under the hood.

Writing a Web Service in .NET using VS .NET very is easy. However, it is possible to write Web Services using the plain .NET SDK. I struggled a lot to write Web Services without VS .NET and tried to find help on the Net. There are a lot of examples available for writing Web Services using VS.NET, but you will rarely find any examples of writing Web Services using only the .NET SDK. This article is exactly for this purpose. It looks at Web Services development using the .NET SDK alone.

Why use Web services ?

Before the arrival of Web services, other technologies and architectures existed that met the functionality of today´s web service. Microsoft's version of these technologies, are called Component Object Model (COM), and subsequently Distributed COM (DCOM). WinDNA is a comprehensive term for implementing the above two distributed software development technologies. These technologies typically use the TCP/IP protocol.

CORBA - Common Object Request Broker is a competitor of COM, developed by a consortium of vendors called the Object Management Group. Although these technologies were a breakthrough in distributed computing and served such ends well for at least five years, there were many limitations. Concerning
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend