Google Answers Logo
View Question
 
Q: C# ASP.NET Adding Web References and hand compiling ( No Answer,   2 Comments )
Question  
Subject: C# ASP.NET Adding Web References and hand compiling
Category: Computers > Programming
Asked by: jcaesar79-ga
List Price: $6.00
Posted: 04 Aug 2004 12:21 PDT
Expires: 03 Sep 2004 12:21 PDT
Question ID: 383503
I have a large project written in C# . Within Visual Studio .NET
(2003) I added a "Web Reference" to let me access MS Reporting
Services installation.

Everything compiles and runs great when I use Visual Studio as the compiler.
However, we also have a custom built build environment using nmake and
csc (both available with the .NET Framework Software Developers kit)
running on a machine that does NOT have the VS.NET IDE installed.

By adding the web reference, the following files got generated and
added to my csproj file:
<Files>
  <Include>
  <!-- Bunch of Pre-existing files aready included in the project,
then these 5 items:-->
    <File
      RelPath = "Web References\webReferenceName\Reference.map"
      BuildAction = "None"
      Generator = "MSDiscoCodeGenerator"
      LastGenOutput = "Reference.cs"
    />
    <File
      RelPath = "Web References\webReferenceName\Reference.cs"
      DependentUpon = "Reference.map"
      SubType = "code"
      BuildAction = "Compile"
      DesignTime = "True"
      AutoGen = "True"
    />
    <File
      RelPath = "Web References\webReferenceName\reportservice.wsdl"
      BuildAction = "None"
    />
    <Folder
      RelPath = "Web References\webReferenceName\"
      WebReferenceUrl = "http://someRemoteServer/ReportServer/reportservice.asmx"
      UrlBehavior = "Static"
    />
    <Folder
      RelPath = "Web References\"
      WebReferences = "TRUE"
    />
  </Include>
</Files>


Since only one of the new files has BuildAction="Compile"
(Reference.cs), this is the only one included in our build script.
What do the others do? Are they needed in the build script?

For example, the vs.net ide generates tons of .resx files. They all
get run through resgen in the background, and then their assemblies
are linked into the final dll that the IDE generates. However, we have
found that NOT including them in the build process (except for when a
developer explicity places things in a resx file and requests their
inclusion) makes for a smaller dll and a cleaner build process.

Since we are set to go live soon with this project, I need to find out
two or three things:
1) What do the other files do ? (least important)
1a) How would I include them in a custom written compile process
(using VS.NET Framework SDK tools ) ? ( more important )
2) Is it necessary to take additional action beyond including the
Reference.cs in my build ? The last thing I would want is something
that seems to build properly, run fine in pre-production testing, then
fail horribly after release, due to a file missing from the process.
(most important)

Thanks !
Answer  
There is no answer at this time.

Comments  
Subject: Re: C# ASP.NET Adding Web References and hand compiling
From: tcarternyc-ga on 09 Aug 2004 11:25 PDT
 
Hi jcaesar79,

Why not simply copy the command line that is available in the output
area of VSNET IDE and place it into a batch file (removing unnecessary
references as needed) -- this may be an alternative to using
specialized components of the SDK (depends on what exactly you want to
do -- for instance you might want to optimize the application, in
which case the SDK would be a better option). One way to find out
exactly what is needed to have the application run 100% is to use the
Copy Application process to a test website. Choose to only copy the
files required for the application to operate instead of all of the
files.

The .resx resource file format consists of XML entries, which specify
objects and strings inside XML tags. One advantage of a .resx file is
that when opened with a text editor (such as Notepad or Microsoft
Word) it can be written to, parsed, and manipulated. When viewing a
.resx file, you can actually see the binary form of an embedded object
(a picture for example) when this binary information is a part of the
resource manifest. Apart from this binary information, a .resx file is
completely readable and maintainable.

ref:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconResourcesInResxFileFormat.asp
Subject: Re: C# ASP.NET Adding Web References and hand compiling
From: jcaesar79-ga on 10 Aug 2004 08:00 PDT
 
Hi tcarternyc,

Thanks for your response. I may have worded my request poorly, since
your comment goes down a different path then the info I am looking
for.

My query isn't about resx files, I know all about them, I simply used
them as an example. If you add a new Web Form to a project, it
automatically adds 3 files to your project( .aspx, .aspx.cs, and
.aspx.resx ). That resx file is included in the build process,
however, unless I have added stuff to it, we have found we can
eliminate it from our manual build with no ill side effects.

The same way I can safely remove the .resx files from my build, I was
looking for a information that said either
a) the .map and .wsdl files are used to generate the reference.cs file.
once this is done, they are no longer used (hence the BuildAction =
"None" in the .csproj for these files)
or 
b) Despite the way it appears ( that these files can be discarded ),
they are actually still needed, vs.net pushes them through
undocumented process abcd at build time, etc.

On our test machine, there are two folders of relevance to this matter.
One folder, build, only contains the .cs files, and relevant .resx
files, from which we generate the assemblies for the website.
These assemblies are then copied over to the website folder, where the
only files are those of BuildAction="Content".

The idea is, we build in one folder, web host and test in another.
Each one contains only the absolutely necessary files for that
folder's task to be achieved. This has worked well so far, however,
web references are new to me, I was looking for some sort of answer
along the lines of A. or B. above, to make sure I wasn't shooting
myself in the foot.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy