I've looked at this question:PrecompileBeforePublish using Msbuild, but it doesn't fully address my issue. In trying to use PrecompileBeforePublish=true for our build of a web application, I am getting an error and build failure when MSBuild encounters a referenced DLL that is not a managed code assembly (it is a 3d party .dll we use for data access). If I set PrecompileBeforePublish=false, or just take the property out of the publish file, the build completes as expected.
My question is whether there are any attributes for this property that can be used to avoid this particular issue, or whether I am just stuck with the simple binary true/false value of the property. I suspect the latter.
To clarify per Sayed's question: I was attempting to precompile the application, so did in fact have PrecompileBeforePublish set to true in my publish profile that I am using to create the deployment package.
We are referencing some .dll's for data access that are compiled as unmanaged code. I suspect what is happening is that when we precompile, since our solution is managed, it (the build process) barfs when it encounters a referenced .dll that is unmanaged. The error we get is: "ASPNETCOMPILER: error ASPCONFIG: Could not load file or assembly 'xxx' or one of its dependencies. An attempt was made to load a program with an incorrect format.