Using Preprocessor Directives In Web Services Project?
Sep 7, 2010
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:
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.
I have created 2 projects in a solution. One project contains Asp.net classes with login page and different other pages.
Another project contains a web service.
When I launch the solution(click F6 in visual studio 2008) the login page can access to the method of the webservice. Both projects are launched.
However when i added this 2 projects into IIS and deploy them (with create command) the login page cannot contact the method of the web service. Even though the web service is running because i can acces it manually. But they cannot communicate each other.
Is it possible to have additional "using" directives automatically added to my new aspx.cs files so that I do not have to keep typing the same ones over and over again (i.e. custom namespace using directives)
At what point (if at any) does it make sense to take some of the features of a .NET web application and split them into separate web services?
For example, we have a very large web application that also calls a series of long running operations (our core business logic). We also have a dll with client-specific custom features that is called directly from the web project. Sometimes we need to move very quickly to change these client functions, often in hours.
However, if we make a change to the client-specific features (or an emergency change to the core features) and publish a new project, then it would kick all the users out the system as the app restarts. It would seem like there's a better way ... but I'm not sure what it might be ...
i have a web service project called (WS_Service) i have a html page thats trying to consume WS_Service. i have web services sits on its own project (the reason i have created is because its independednt and can be called from .aspx or .html or mobile) i dont have problem with .aspx and i have just add the reference and fire the services. but i am not sure how i will be doing on .html page below is my code i am trying to POST to a web service:
Do you keep the developer's control panel and the application's web service, in 1 project? or do you separate them into 2 different projects?(Developer's control panel, is used to setup the web service API, check logs, read document specification, and details about each web service)When you host the solution you would do something like this..developer.domain.com <-- developer's control panel
api.domain.com <--- web service api or api.domain.com <-- both developer's control pnel and web service api
I am finding an issue with build release of asp.net project. The code files page attributes gets changed after build.
The code is <%@ Page Language="C#" AutoEventWireup="true" ValidateRequest ="false" CodeFile="~/AssociateJob.aspx.cs" Inherits="XXXXXX.AssociateJob" %> And build is: <%@ page language="C#" autoeventwireup="true" validaterequest="false" inherits=" XXXXXX.AssociateJob, XXXXXX_deploy" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>
After build, we expect only highlighted portion should be different, rest all should be the same. Three attributes (enableviewstatemac, enableEventValidation, viewStateEncryptionMode) are coming extra in the deployment. We use FinalBuilder to build the project, which uses MSBuild internally.
How to Find All the Web Services and Windows Services Running on a Server in ASP.Net. I have the server details with me and want to find all the Web services running on it.
I am using Visual Studio 2010 Release candidate1. I have to deploy my web application which consists of a website, certain window services, certain WCF services and Sql Server 2005 database.I read Vishal Joshi's blog(http://vishaljoshi.blogspot.com/2009/09/overview-post-for-web-deployment-in-vs.html) detaing Web Package in VS2010. I want to know how to deploy window services and WCF services using Web Package. Also, I want to create a web setup (.msi) for deployment instead of Web Package so that the .msi takes care of all the application and database deployment like the web package does.
When I turn on Code Coverage in my test settings, on a project that references the Unity DI container I get the following error:
Cannot initialize the ASP.NET project'{Project Name}'.
The event log specifies the following reason:
Could not load file or assembly 'Microsoft.Practices.Unity, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified.
I am using HTML controls while using Ajax in my .net project. Now I want to make my text box to be autocomplete. I am fetching a data using a query for the respective typed text but i am not sure how to bind that data to text box and show it the way it is being displayed in google and other famous sites. I would also love to know the way using web services. Which way is more efficient?
Makes it sense to use ASP.NET applications together with WCF RIA Services or WCF Data Services (to encapsulate the data access layer) ? Or are these technolgies only useful for Silverlight applications.
I have downloaded a project from the internet called the SMS Source example. I wanted to open this project in VS2010, so a conversion wizard has popped up prompting for the conversion. But it has errors in converting.
On the Timelog page, I want to put 2 dropdown list: 1 Manufacturing Project, 1 Engineer Project. However, users can choose either Manufacturing project dropdown or Engineer project dropdown (not both).
I'm trying create unit testing for an existing website project (not web application project). I cannot access my under test classes unless I use accessor. However, if I use accessor, I have problem to initiate an object with passing arguments. I only want to create unit tetsing for App_Code. After searching web, and I found that I'd better to create a web application project using my current existing website project. From solution explorer, add new project ->using existing website. My questions is: what impact will have for my current website to create the new project? Should I just convert my current website to web application? If do that, will it cuase problems on my website? I am new on asp.net, still learning..
We are upgrading .Net 2.0 Framework Web service project to .Net 3.5 Project. We are not changing any methods. Will there be any change in the proxy because of this Framework Upgrade.My requirement is to all the existing clients consuming this webservice should not have any impact due to this framework upgrade.
Approximate cost of the project Duration of the project ( There are 2 Developers ) Can I charge the client for software license ( like Visual Studio license since I have purchased it by paying a hefty amount)
My profile as a developer is as follows:
I am a C#, .net, ASP.net developer with 3 years experience in enterprise class web and desktop projects. I can work 20 hours a week
The brief requirements of the project are as follows::
I have to develop an Ecommerce website. The website is meant for buyers, sellers, advertisers and bidders ( I would say it is Business to Business and also Business to Customer site ) The HTML's will be given by the client. The website will have all the features of any Ecommerce site like buying products, selling them, searching products, sorting them,etc The website should conform to W3C standards
I just converted an ASP.NET Web Site Project to a Web Application Project in VS 2010. After I run the application though it seems that my class polymorphism broke. I don't have a clue as to why this could occur.
So in the following code when I call base.OnLoad(e) I am getting errors in the base class because the variable myString is null. In fact all the variables for the Base class are null. I can do
Let's say I have a Visual Studio solution with a Web project, a BLL project, and a DAL project. I'm trying to follow the repository pattern keeping my SQL code in the DAL with an interface that is referenced by the BLL.
I have a handful of common solutions for things such as error handling, usage logging, and other things that can be considered utility functions (i.e. not in the business spec). I'm keeping these in a Common project.
Here are a few ideas I've had with regards to structuring the Common project...
Bundle SQL with logic in a given class
Create a layered solution within the Common project
Discard the Common project and put utility functions in with BLL/DAL
Is one of these ideas better/worse than the other? Does anyone have a better solution?
It's worth noting that these utility functions will be reused in a variety of other applications.
Taken from http://msdn.microsoft.com/en-us/library/dd410597(VS.100).aspx ...
If you are using the Standard or Express editions of Visual Studio, the Create Unit Test Project dialog box is not displayed. Instead, the new MVC application project is generated without a test project.
I recently updated my VS2010 website project from .NET 3.5 to 4.0. Everything was working fine in the website project. Today I decided to migrate the website to a web application project as I have learned this is the best way to work in .NET. I split out all my class files into a separate class library and copied all my other content into my new project. Then I updated all the references and web.config.
When I build the class library, everything works great. The problem is happening when I try to build/debug the web application project. It is acting like all the controls are missing and it is also throwing a bunch of compile errors about the public properties I have in my master pages.
Control errors: "The name 'INSERT CONTROL NAME HERE' does not exist in the current context"
Master page errors:'System.Web.UI.MasterPage' does not contain a definition....
It is giving these errors for every single control and master page property in my entire solution.I notice when I add a new web.form to this project, it also adds a filename.aspx.designer.cs file in addition to the .aspx and .aspx.cs file. My existing files do not have these extra files since they were created in a different .NET version.
UPDATE: It seems I was missing the step where I need to right click on the new application folder and select "Convert to web application". I just did that and it seems to be a little bit better...
Now it is choking on Literals that are inside single quotes: