sachin jain
sachin jain

Reputation: 224

Code changes in the Source file(.cs) not reflected in the application

I have a website that I have to migrate to our servers with few code changes. Here is the scenario:

We have a website that was written by some other Vendor and now we have to migrate that website to a different server with some minor code changes. The problem is that they have a custom dll sat Test.dll which has a file say Person.cs, now that file is also present as a source file in the website(Project) which is required because we have to make changes to it or might have to in future. But when I make changes in the source code of Person.cs I don't see those changes reflected in my application because it is picking up the Person.cs file from the dll which after reading some online posts and document is how .net works although java works the other way.

I am very new to .net so cant think of a solution here any comments or suggestion will be greatly appreciated.

Upvotes: 0

Views: 2327

Answers (3)

Darshan Puranik
Darshan Puranik

Reputation: 1083

I created a website to host WCF service in IIS. I created profile to publish website and make my life easy. I didnt want to drag drop DLLs from WCF service to website so I put a condition that compile code before every publish.

The code for profile looks as follows:

<?xml version="1.0" encoding="utf-8"?>

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>x86</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <publishUrl>C:\TestWebsite</publishUrl>
    <DeleteExistingFiles>True</DeleteExistingFiles>
    <PrecompileBeforePublish>True</PrecompileBeforePublish>
    <EnableUpdateable>True</EnableUpdateable>
    <DebugSymbols>True</DebugSymbols>
    <WDPMergeOption>DonotMerge</WDPMergeOption>
  </PropertyGroup>
</Project>

The line which make sure that the code is compiled prior to publishing:

<PrecompileBeforePublish>True</PrecompileBeforePublish>

Upvotes: 0

Rick
Rick

Reputation: 1

What likely happened is your vendor didn't supply you with a solution (.sln) file. You probably need to start with a blank web site. It's difficult to determine if this is a webforms or mvc site due to the limited amount of information.

Upvotes: 0

Marc Gravell
Marc Gravell

Reputation: 1064004

If it is a web project, the c# code is compiled during project build. To get your changes to take you will need to rebuild the project, generating new binaries.

Upvotes: 1

Related Questions