By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,563 Members | 1,205 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,563 IT Pros & Developers. It's quick & easy.

Something else: Unsafe code gives a error CS1577: Assembly generation failed

P: n/a
Wel, I am rebuilding the VC# 2002 project that I have deployment problems
with the 2003 version, hoping this solves the problems, but now I encounter
this wierd bug???

If I have the project, and do not compile with "Allow Unsafe Code
Blocks=false" set to true, then the project compiles and no problems.
BUT if I compile with "Allow Unsafe Code Blocks=true" then I het the error
below. With unsafe {} of unsave{} removed it dos not solve the problem.
Maybe this is also related to thge installation problem I had?????

(In VC# 2002 this compiled without problems. )

------ Build started: Project: CtRepair, Configuration: Debug .NET ------
Preparing resources...
Updating references...
Performing main compilation...
error CS1577: Assembly generation failed -- Unexpected exception processing
attribute -- System.ArgumentException: Invalid directory on URL..
Build complete -- 1 errors, 0 warnings
Building satellite assemblies...
Satellite assemblies could not be built because the main project output is
missing.

---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped

Nov 15 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
<Ol**********@skyscan.be> wrote:
Wel, I am rebuilding the VC# 2002 project that I have deployment problems
with the 2003 version, hoping this solves the problems, but now I encounter
this wierd bug???

If I have the project, and do not compile with "Allow Unsafe Code
Blocks=false" set to true, then the project compiles and no problems.
BUT if I compile with "Allow Unsafe Code Blocks=true" then I het the error
below. With unsafe {} of unsave{} removed it dos not solve the problem.
Maybe this is also related to thge installation problem I had?????


Well, when it shows that error, does it show which attribute it's
processing?

Does it happen if you just start a new effectively blank project and
turn unsafe code on?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2

P: n/a
> > Wel, I am rebuilding the VC# 2002 project that I have deployment
problems
with the 2003 version, hoping this solves the problems, but now I encounter this wierd bug???

If I have the project, and do not compile with "Allow Unsafe Code
Blocks=false" set to true, then the project compiles and no problems.
BUT if I compile with "Allow Unsafe Code Blocks=true" then I het the error below. With unsafe {} of unsave{} removed it dos not solve the problem.
Maybe this is also related to thge installation problem I had?????
Well, when it shows that error, does it show which attribute it's
processing?

No, only this line in the output: "error CS1577: Assembly generation
failed -- Unexpected exception processing
attribute -- System.ArgumentException: Invalid directory on URL"..

And this line as task: "Assembly generation failed -- Unexpected exception
processing attribute -- System.ArgumentException: Invalid directory on
URL.".
Does it happen if you just start a new effectively blank project and
turn unsafe code on?

Yes,I just tested.

This is VC# 2003 standard.
But on this machine VC# standard and VC++ 2002 standard are also installed
so is VC 6 professional.
Also .NET 1.0, .NET 1.1 (all English version) and any critical update from
Windows...
(All official versions!)

Maybe this is related to the installation trouble I have. ???


Nov 15 '05 #3

P: n/a
<Ol**********@skyscan.be> wrote:
Does it happen if you just start a new effectively blank project and
turn unsafe code on?
Yes,I just tested.


That sounds like your installation of VC# is a bit broken.

It certainly works fine if I just turn unsafe code blocks on for a
random project in my VS.NET 2003 installation.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #4

P: n/a
> > > Does it happen if you just start a new effectively blank project and
turn unsafe code on?

Yes,I just tested.


That sounds like your installation of VC# is a bit broken.

It certainly works fine if I just turn unsafe code blocks on for a
random project in my VS.NET 2003 installation.

I just installed it today. But I am going to try the repair function, maybe
it solves the problem.
I did uninstall the VC# 2002 to be sure that I do not have conflict between
installations.

But thanks for the replies. :-)
Olaf

Nov 15 '05 #5

P: n/a
> > > If I have the project, and do not compile with "Allow Unsafe Code
Blocks=false" set to true, then the project compiles and no problems.
BUT if I compile with "Allow Unsafe Code Blocks=true" then I het the error below. With unsafe {} of unsave{} removed it dos not solve the problem. Maybe this is also related to thge installation problem I had?????


Well, when it shows that error, does it show which attribute it's
processing?

No, only this line in the output: "error CS1577: Assembly generation
failed -- Unexpected exception processing
attribute -- System.ArgumentException: Invalid directory on URL"..

And this line as task: "Assembly generation failed -- Unexpected exception
processing attribute -- System.ArgumentException: Invalid directory on
URL.".

I just reinstalled everyting (VC# 2003 standard), but the problem persits
I create a new project, compile=ok, then turn on to allow unsafe code and
the dreaded "error CS1577: Assembly generation failed -- Unexpected
exception processing....."

The 2003 did not have problems with this.
Any tips would be welcome. :-)

Olaf

Nov 15 '05 #6

P: n/a
> > > Does it happen if you just start a new effectively blank project and
turn unsafe code on?

Yes,I just tested.


That sounds like your installation of VC# is a bit broken.

It certainly works fine if I just turn unsafe code blocks on for a
random project in my VS.NET 2003 installation.


I repaired everything. The unsafe option still gives this dreaded error:

No, only this line in the output: "error CS1577: Assembly generation
failed -- Unexpected exception processing
attribute -- System.ArgumentException: Invalid directory on URL"..

And this line as task: "Assembly generation failed -- Unexpected exception
processing attribute -- System.ArgumentException: Invalid directory on
URL.".

It doens't matter if I create a completely new class project or empty form
project.

Then I uninstalled the VC# 2003 and VC# 2002 completely, rebooted and
reinstalled VC# 2003.
Guess what? This error is back once I try to compile allowing unsafe code.
:-(

And I must use unsafe code since I need pointer typecasting to read in our
file formats. .

VC# 2002 did compile without trouble!

Anybody out there that have any idea why this happens?
Or what it means?

I have no idea what directory or URL it is refering to...
Nov 15 '05 #7

P: n/a
> > No, only this line in the output: "error CS1577: Assembly generation
failed -- Unexpected exception processing
attribute -- System.ArgumentException: Invalid directory on URL"..

And this line as task: "Assembly generation failed -- Unexpected exception processing attribute -- System.ArgumentException: Invalid directory on
URL.".

I just reinstalled everyting (VC# 2003 standard), but the problem persits
I create a new project, compile=ok, then turn on to allow unsafe code and
the dreaded "error CS1577: Assembly generation failed -- Unexpected
exception processing....."

The 2003 did not have problems with this.
Any tips would be welcome. :-)

I finally managed to discover that the error occurs in the CSharp csc.exe
compiler itself, and seems to be not part of my the program.
I took a supidly simple console program.

And I compile using the command line compiler like this:

***D:\Source\Scratch\Managed\Testing\ConsoleApplic ation1>csc.exe /out:clas
:exe /r:MSCorLib.dll class1.cs***

This is the result that I get, and the exe is there and works fine:

*** Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
***
***for Microsoft (R) .NET Framework version 1.1.4322
***
***Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.
***

Now I add one simple additional command "/unsafe+"

***D:\Source\Scratch\Managed\Testing\ConsoleApplic ation1>csc.exe /out:clas
:exe /r:MSCorLib.dll /unsafe+ class1.cs***

And here is the result I get from the compiler

***Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
***
***for Microsoft (R) .NET Framework version 1.1.4322
***
***Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.
***
***
***
***error CS1577: Assembly generation failed -- Unexpected exception
proces***
*** attribute -- System.ArgumentException: Invalid directory on URL
***

So it seems that this *System.ArgumentException* is an error from the
csc.exe compiler???

One odd thing is that when I use "/unsafe-" (minus) then it compiles
without problems.

This works fine using the VC# 2002!!!!! And it also works fine using VC#
2003 at a different computer installed from the same installation disk.

Mysteries, mysteries,....
Anyone idea's what else to check?

Nov 15 '05 #8

P: n/a
> Now I add one simple additional command "/unsafe+"

***D:\Source\Scratch\Managed\Testing\ConsoleApplic ation1>csc.exe /out:clas
:exe /r:MSCorLib.dll /unsafe+ class1.cs***

And here is the result I get from the compiler

***Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
***
***for Microsoft (R) .NET Framework version 1.1.4322
***
***Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.
***
***
***
***error CS1577: Assembly generation failed -- Unexpected exception
proces***
*** attribute -- System.ArgumentException: Invalid directory on URL
***


One final test I did was using the C# csc.exe from framework 1.0 and this
one DID compile with "/unsafe+" !!!!!
See below:

D:\Source\Scratch\Managed\Testing\ConsoleApplicati on1>C:\WINNT\Microsoft.NET
\Fra
mework\v1.0.3705\csc /out:test.exe /unsafe+ class1.cs
Microsoft (R) Visual C# .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.0.3705
Copyright (C) Microsoft Corporation 2001. All rights reserved.

Nov 15 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.