|
But then I'm blinded and can't see the screen at all.
|
|
|
|
|
We are so awesome that the answer should appear without needing any input.
|
|
|
|
|
Yes, quite often that is the case, but still we need to share it with the world.
|
|
|
|
|
What is so odd about that? You have the "using" statement pointing to the Word namespace, you don't need to prefix Application with it (as in the second section that works).
A bit about namespace type name conflicts: alias the using statement. That way you don't have to type System.XML.Blah.Foo.Bar.Typename if you also have System.Word.Blah.Meh.Foo.Bar.Typename, you can type Foobar.Typename to get one, and MehFoo.Typename to get the other by aliasing the using statment via "using Foobar = System.XML.Blah.Foo.Bar" and "using MehFoo = System.Word.Blah.Meh.Foo.Bar".
|
|
|
|
|
Hello,
I'm having some problems in my solution. I have a project (a .dll) that contains interfaces for all my other projects. I decided to remove the namespaces and move them all into the same, and when I had done that I updated all my files to compile. However, I am now getting an exception while loading that a type that was previously in a namespace in the interface dll cannot be loaded.
"{"Could not load type 'Moonlite.ExtensionApi.GlobalInterfaces.IProjectTemplate' from assembly 'Moonlite.ExtensionApi, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null'.":"Moonlite.ExtensionApi.GlobalInterfaces.IProjectTemplate"}"
I searched my entire harddrive, searched the GAC, literally everything I can think of, however the only copy of the interface dll is in the binary folder. I can't think of anything else I could do.
Please note that this is very urgent, as I have an upcoming release, so any help is appreciated.
Another note - I use MEF.
Thanks,
Theo
|
|
|
|
|
Have you shutdown VS and restarted it?
Please note asking for urgent help is considered rude here.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Have you tried a clean build? i.e. remove the obj folders, click Build/CleanSolution, then build it all over.
|
|
|
|
|
Mark:
Yes, I have shutdown VS and restarted it.
I'm sorry - it will not happen again.
Luc:
Yes - I tried removing all binary files, all bin/obj folders, etc.
|
|
|
|
|
Do you have a clean development environment in a VM? If so, copy the source-files and rebuild there. If no, you might as well create such an environment while waiting for a decent answer that actually solves the problem.
I are Troll
|
|
|
|
|
I'm not sure I get what you mean. Could you please elabroate?
|
|
|
|
|
You could install Windows and Visual Studio in a Virtual Machine, using Virtual PC 2007[^] for example. That way you'd always have a clean environment
As is now, it would be guessing at the problem. Did you by any chance register any of the dll's as COM-controls?
I are Troll
|
|
|
|
|
That seems a bit much work for that - I think I'd rather keep trying things. Thanks for the tip, though.
I didn't register them as COM, no.
|
|
|
|
|
Is the old version in the GAC?
Oh, you said not.
|
|
|
|
|
Hi,
I have the following linq code within my app
var results = (from t in query
where t.ProjectID == new Guid(this.Session["ProjectID"].ToString())
orderby t.Number ascending
select new
{
ID = t.ID,
Tag = t.Number,
Description = t.Description,
SubSystems = GeneralHelper.TagSubSystems(t),
Module = t.Area.Module.Name,
Discipline = t.Discipline.Name,
ITRs = GeneralHelper.TagITRsHTML(t)
});
I want to pass the query result to another function to handle my paging. I currently have another function defined like this
public void BindGridData(IQueryable result)
{
gridView.DataSource = result;
gridView.DataBind();
}
It works like this, but the problem is I cannot do "take" or "skip" on "result" because it's declared as IQueryable. Is there a work around to handle this?
Thanks
|
|
|
|
|
convert the linq result to list
var results = (from t in query
where t.ProjectID == new Guid(this.Session["ProjectID"].ToString())
orderby t.Number ascending
select new
{
ID = t.ID,
Tag = t.Number,
Description = t.Description,
SubSystems = GeneralHelper.TagSubSystems(t),
Module = t.Area.Module.Name,
Discipline = t.Discipline.Name,
ITRs = GeneralHelper.TagITRsHTML(t)
}).ToList();
|
|
|
|
|
If I convert it to list, then how do I define the function that takes the query result?
|
|
|
|
|
public void BindGridData(IEnumerable result)
{
gridView.DataSource = result;
gridView.DataBind();
}
Also note the use of the pre tags to properly format the code snippet
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
IEnumerable requires an argument,
IEnumerable result
any idea what argument would work?
|
|
|
|
|
Create a structure to represent your query results, instead of using anonymous types. Then you know what kind of IEnumerable it is.
Alternatively, make your Bind function generic, like so:
public void BindGridData<T>(IEnumerable<T> result)
{
gridView.DataSource = result;
gridView.DataBind();
}
|
|
|
|
|
|
Although I agree a concrete type is better for readability and good design it isn't necessary in order to pass the query to a method.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
the reason i didnt define a concrete type is because the function will be accepting queries from different classes
|
|
|
|
|
Ok, then the second solution is best
Oh, and you don't need to do a ToList() if you're going that route. Linq results are all IEnumerable.
|
|
|
|
|
Using generics, as Ian has suggested, doesn't preclude you from doing that. You would just need to create the class/struct for each query, which from a architectural perspective isn't a bad idea. However, if you have many different queries that are possible then perhaps you need to improve your design, one size fits all implementation are very difficult to maintain.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
One more thing,
lets say I store "result" in session variable like this
public void BindGridData<t>(IEnumerable<t> result)
{
Session["result"] = result;
gridView.DataSource = result;
gridView.DataBind();
}
and then I want to call this function within another event, how do I call it? how do I cast Session["result"]?
Thanks
|
|
|
|