Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 07, 2008 12:31 PM by Utkan Celik
Apr 03, 2008 03:12 PM|LINK
Hi everyone, my team is using a webdeployment project and we have a project reference which is a code library (so it is not a web project). I was able to raise the warning level and TreatWarningsAsErrors for the web project by adding the following entries
in the web.config file.
type="Microsoft.CSharp.CSharpCodeProvider, System,Version=2.0.3600.0, Culture=neutral,PublicKeyToken=b77a5c561934e089"
I would like to do the same thing for the project we are referencing
Can you please point me to the right direction on how to achive this. I tried adding following elements to the <PropertyGroup> but did not work for me. Since web project is getting compiled with aspnet_compiler.exe I was wondering referenced project will
be compiled with csc.exe since it is NOT a web project.
Any insight on how to achive this will be greatly appriciated.
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<!--Sets the appropriate warning level, from 0-4 -->
<!--Optional Boolean parameter.If true, treats all warnings as errors.-->
VS 2005 Web Deployment Projects
Visual Studio 2005 Web Deployment Projects
VS 2005 Web Deployment Project
Web Deployment Project
web deployment projects
Apr 03, 2008 07:46 PM|LINK
In Visual Studio, when you right click on a class library project and choose "Properties", you will see a "Build" tab where you can set the warning level and to specify treat warning as errors.
Are you not able to do that for your referenced project?
Apr 03, 2008 08:20 PM|LINK
I am able to do that from Visual Studio, but I want to do that from a webdeployment project by using (or passing ) compiler switches.
Something like this
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WebDeployment\v8.0\Microsoft.WebDeployment.targets" />
........ more targets and properties.
Apr 03, 2008 08:27 PM|LINK
What kind of project is this "referenced project" you are referring to? And how are its compilation settings related to the web deployment project?
I don't fully understand what you are trying to achieve. You have three projects in your solution if I understand correctly: Web site, Web deployment project, Referenced project.
You mentioned you get warnings as errors for the web site. Are you trying to get warnings as errors for the referenced project? If so, why is it not possible to just set that setting in the referenced project?
Apr 03, 2008 08:45 PM|LINK
Thank you for you interest and sorry for the confusion.
I am using msbuild which inturn calls webdeploy.wdproj for compiling a website which has a reference to a Class Library. And webdeploy.wdproj is not included in my solution file. (My solution has 11 websites and a class library but with help of msbuild
I am able to use just one webdeployment project file and call it multiple times from msbuild)
What I am trying to achieve is: I don't want to modify project file for the class library, and I want to be able to use
<WarningLevel><TreatWarningsAsErrors> elements in the webdeployment project file.
Apr 03, 2008 08:53 PM|LINK
Do you mean that when you are compiling the individual class library, you do not want treatWarningsAsErrors for this class library?
And that you only want treatWarningAsErrors for the class library when you are building webdeploy.wdproj?
Apr 04, 2008 01:52 PM|LINK
Apr 04, 2008 06:20 PM|LINK
Thank you for the clarification.
This sounds more like a msbuild question, perhaps you might also want to try the msbuild forums. I am not sure if it is specific to web deployment projects, since the main question seems to be how to set certain properties to be passed to the actual project
specified in ProjectReference?
Apr 07, 2008 12:31 PM|LINK
Thanks you for your advise. I will try msbuil forums. For now I modified the project file for the class library and web.config file for the web project and it is working fine.