Greetings,

Recently came across the CruiseControl.net site and realized it was
essentially a build server in a box and everything I'd been looking
for. I Got it all up and running within ten minutes and have overall
been quite happy with it. We haven't gone to full use yet, but I've
been setting up solutions as a way to learn the system.

and I've come across a problem I haven't been able to find any
reference to on the site, on the mailing list or via googling.

I have a .net 1.1 solution with 18 projects in it, which I have
unfortunately inherited as legacy code. We plan to eventually upgrade
everything to the most current CLR but after like three years of
saying that I'm not going to hold my breath. So in the mean time I
need to deal with the reality of the outdated version.

In the meant time I've gotten the solution running using a DevEnv
task, pulling fresh code from a subversion repository. This works just
fine for a debug configuration of the solution but breaks in release
configuration. However, building through visual studio works fine in
any configuration. Recently I moved some 'unsafe' code (it used
pointers) into an existing DLL so as to eliminate an extra DLL that
had nothing else in it. Basically it was taking up space so I saw no
point in having the code as a separate DLL.

Now when CC builds the solution in release mode I get:
2009-12-22 17:22:19,961 [7:DEBUG] [MySolution c:\Program Files
\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.com] D:\Code
\unsafecode.cs(575,36): error CS0227: Unsafe code may only appear if
compiling with /unsafe

The thing is that the /unsafe compiler flag is enabled in that project
for all configurations. I checked it when I moved the code over. But
it doesn't seem to be getting noticed. Rather than attempt to deal
with it I simply re-wrote the unsafe block to use safe methods. This
didn't fix the above problem, which I found odd since I'd rewritten
everything that was unsafe. I even went so far as to comment out the
unsafe block and the code that calls it and then remove the /unsafe
flag entirely before checking in and do do a global search of the
project that is failing and the rest of the solution for instances of
the 'unsafe' keyword and can verify that it's not there (or at least
commented out).

None of these fixed the above error. I'm not entirely sure what's
going on with it. I can see that the changes are coming out of
subversion correctly into the working directory. I can verify that the
file does in fact have the unsafe code and calling code commented out
(or re-written as the case may be) but I'm still getting the error
noted above. Unfortunately it's in a project that is referenced by a
number of the other projects in the solution so once this one fails to
build, the entire build is pretty much toast.

I've also opened the solution and project files in question in notepad+
+ so as to read the underlying text directly just to make sure and to
verify that I'm doing what I think I'm doing (sometimes VS 2003 can be
trixy and false). As noted the solution builds in all configurations
with no problems within visual studio itself. The issue seems to be
that the /unsafe flag isn't being passed to devenv from CC's call
though I don't really understand why it would still need it since I re-
wrote the unsafe code.

Does anyone have any advice or thoughts as to what is going on here or
how to fix this problem?

Thanks

EK

Reply via email to