all groups > dotnet windows forms designtime > october 2005 >
You're in the

dotnet windows forms designtime

group:

"Ensure that the file is a valid .Net Framework assembly.


Re: "Ensure that the file is a valid .Net Framework assembly. Chris McKenzie
10/11/2005 12:00:00 AM
dotnet windows forms designtime:
Okay, I've more info now.

I think it's a Visual Studio or Reflection bug. You can find the steps to
reproduce it here:
http://weblogs.asp.net/taganov/archive/2005/10/11/427247.aspx

Argh.

CHris

[quoted text, click to view]

"Ensure that the file is a valid .Net Framework assembly. Chris McKenzie
10/11/2005 10:25:00 AM
I've got a dll project containing a set of windows forms user controls. I'm
trying to add an inherited control, but I keep getting the following error:

"Unable to load assembly '<my assembly>'. Ensure that the file is a valid
..Net Framework assembly.

Up until today I have been able to add inherited controls to my project
without an issue. A google search did not reveal much in the way of help on
this issue. Does anyone know what I should do to resolve this issue?

Thanks,
Chris

Re: "Ensure that the file is a valid .Net Framework assembly. david.brunning NO[at]SPAM dsl.pipex.com
10/13/2005 1:09:25 AM
Hi Chris,
I've read your blog with interest - I am having the same problem and
finding it extremely annoying and difficult to track down. I'm not
sure its just a code thing - I can get my inheritance picker to work on
and off (seemingly randomly).

I've tried:
* Deleting "%My profile%\Application Data\Microsoft\VisualStudio\7.1"
and restarting VS - no effect
* Updating the project references path on each project to remove
incorrect paths - inheritance picker worked once then stopped
* Updating file permissions and removing read only flag from the
obj\debug folders - inheritance picker worked once then stopped
* Changing to file references rather than project references -
inheritance picker worked once then stopped
* Changing file path of projects to remove "#" character from working
folder - no effect

I've also found that sometimes I can add inherited controls to the
project which is at the top of the dependency tree (My "Common"
project) without a problem, but then the next time I try that stops
working too! GRrrrrrrrr

I'm not convinced of the cause but I find it odd that random things
seem to fix it once then it stops again. I can't believe its a file
based thing, but VS seems to be doing a lot of stuff in the background
when building a project - I have found at least 6 different cached
versions of objects on my machine - and I wonder if that is the cause.
I haven't yet tried removing projects one by one to see what effect
that has but that's my next stop.

Any other ideas? Anyone even care? Losing the will to live?
Re: "Ensure that the file is a valid .Net Framework assembly. david.brunning NO[at]SPAM dsl.pipex.com
10/13/2005 1:45:32 AM
I've also now tried isolating my Common project - the same thing
happens in a solution whcich only contains a single project so it's not
just to do with cross project inheritance or implementations.

That's it - I'm joining the circus - Oh, I already have...
Re: "Ensure that the file is a valid .Net Framework assembly. david.brunning NO[at]SPAM dsl.pipex.com
10/13/2005 1:55:56 AM
Spam the group? Never...

If I do a "rebuild solution" (Rebuild, not build) then the inheritance
picker gets built correctly every time (As long as I rebuild everytime
I want to add an inherited control - if I make a code change and don't
rebuild it seems to invalidate my assembly cache and the inheritance
picker once again stops working).

Unfortunately once I select the base class to inherit from I now get an
error "Unable to add reference '%BaseType%' to the current application.
Check that a different version of '%BaseType%' is not already
referenced".

Have you seen that?
Re: "Ensure that the file is a valid .Net Framework assembly. Chris McKenzie
10/21/2005 9:14:37 AM
I've definitely seen some wierdness going on. A day after I posted my blog,
my test project started working fine. My primary project still fails to add
inherited controls. Argh!

Chris

[quoted text, click to view]

AddThis Social Bookmark Button