i've got blinq running nicely in a VS Web Site Project. However I much prefer the 'Web Application Project' (WAP) model but i cannot get a blinq project to compile. the compile errors are all in the StaticMethods.cs file, and they are all of the following
form:
'System.Query.IQueryable<MySite.ApplicationSetting>' does not contain a definition for 'Count'
The project compiles no problem if i exclude the StaticMethods file, the main file containing the Table classes has no problems compiling. also intellisense is aware of the supposedly missing methods. to set up the WAP project i copy/pasted the 2 App_Code
files from the blinq generated folder into a web application project, keeping the same web.config, and adding all the references to bin files.
can anyone suggest what might be wrong? has anyone else got a WAP project working with blinq?
Is this a designtime-only problem or a runtime problem as well? It sounds like the project isn't using either the settings in web.config or the libraries in Bin.
Polita Paulus
This posting is provided "AS IS" with no warranties, and confers no rights.
it is a design-time problem at least, and since it can't compile (WAP) i can't get check how it would go at run-time.
i'm using the exact same web.config that blinq generated, with the same 'bin' folder contents, it is marked as an application in IIS but as far as i know VS doesn't pay attention to that for WAPs. I wouldn't worry too much about it because VS has plenty
of bugs relating to web application projects, intellisense, designer support etc., that i am hoping will be largely sorted out with the release of SP1, although the beta wasn't too inspiring.
i've started using Web Projects again and i can live with it no problem, it sounds like more of a VS/WAP problem than anything wrong with Blinq itself.
if you'd like to follow it up further i can forward you the solution no problem, but it sounds like everything is fairly busy on the asp.net team!
Tim, I apologize for the problems you're having with WAP and VS. Having two web project paradigms has been a challenge for our team, and we haven't always handled it in the best way. I understand that this is frustrating for our customers.
I will reply to you privately to get your project files so I can try to repro your problem.
Polita Paulus
This posting is provided "AS IS" with no warranties, and confers no rights.
hi, it doesn't appear to work in the current release of VS 2005 / Orcas May CTP. there's a good chance it will work with the coming releases of VS 2005 SP1 (for vista) and the February CTP of orcas. it does work fine as a web project in VS so i have adopted
that project model just for these projects.
in my situation, the great discovery of Blinq was Linq and SqlMetal, which i had never used before. the user interfaces that blinq produces are certainly an achievement in terms of code automation, but the lack of type validation in the DetailsView control,
and lack of fidelity to the sql table schema (e.g. allowing null values or not, setting maxLength of TextBox controls to match the column field size etc), make it impractical out-of-the-box IMHO. currently i use Blinq purely for the 2 code files it generates,
StaticMethods.cs, and of course the SqlMetal DataContext class for the database. i use my own code generator tool for the front-end.
blinq is also a great example of what is possible with Linq and i have learned a lot from the techniques used in the blinq code.
to answer the question... yes it's definitely worth ditching WAP, at least for a few months until they iron out the 'VS mess', hopefully with the release of SP1 for vista. VS 2005 has turned into a beast IMHO, it often takes about 20 minutes to install
a simple add-on. why didn't they just go for an Xcopy deployment with a "plugins" folder? that's probably horribly simplistic, but i think i'm not alone in saying that we are all far too experienced at uninstalling and reinstalling VS, and of course all
the nonsense about having to install various components in an exact order. e.g. SQL 2005 report designer etc. it is a great product, and i'll never go back to notepad obviously, but i think i've earned the right to rant about it at least :)
Thanks for the in-depth response. When you say "my own code generator tool", do you mean one you wrote from scratch (wow) or just something other than BLINQ?
hi, yes i did write one from scratch, but it isn't all that amazing really. all the web apps i develop have some similarities and i see it as a labour saving device more than anything else. i've read that many people have some sort of code generator tool
they've worked on over the years. there are lots of free ones and commercial ones, but i wanted one that was not too hot or too cold, one that is 'just right'. i'm quite pleased with it.
for example, taking a stored-procedure (schema extracted from the sql database via the SMO API), it will generate a fully functional aspx front-end page for that stored procedure, along with code behind to handle the updates and initialisation, making good
use of the SqlMetal generated strongly-typed methods for executing the stored procedure. it's really not rocket science, and my approach is quite basic, iterate through all the columns included in the stored procedure, if not nullable then add a requiredfieldvalidator,
if datetime then add a DatePicker control, else if numeric then add a regularexpressionvalidator, if it's a foreign key column then render a dropdownlist instead, databound to the foreign key table, otherwise just render a textbox etc. loads of if/else code
basically, but it works just the way i like it and it means i can roll out data-driven web apps very easily. it takes the donkey work out of development. as an example of what i mean by donkey work, consider how much effort we put into designing the database
first, specify a column to have a max size of say 50 chars, but then we have to go into the aspx as well to the corresponding textbox for this field, and manually set the MaxLength to 50? and hook up required field validators when we already set the database
field to non-nullable? it shouldn't need to be done twice, and tooltips as well, i always set column descriptions in the table schema, and my tool makes sure to pick these up and use them automatically for tooltips.
i think there are much more elegant implementations out there which actually use the language grammar to generate the code. i just use a stringbuilder and output the result to screen, or a tmp file etc. if you do loads of programming, and you spot patterns
to what you do, it's very easy to write a few scripts that do the work for you. i have found it to be very worthwhile.
tim_mackey
Member
54 Points
19 Posts
can't compile in Web Application Project
Nov 21, 2006 05:33 PM|LINK
i've got blinq running nicely in a VS Web Site Project. However I much prefer the 'Web Application Project' (WAP) model but i cannot get a blinq project to compile. the compile errors are all in the StaticMethods.cs file, and they are all of the following form:
The project compiles no problem if i exclude the StaticMethods file, the main file containing the Table classes has no problems compiling. also intellisense is aware of the supposedly missing methods. to set up the WAP project i copy/pasted the 2 App_Code files from the blinq generated folder into a web application project, keeping the same web.config, and adding all the references to bin files.
can anyone suggest what might be wrong? has anyone else got a WAP project working with blinq?
thanks in advance
tim.
phuff
Contributor
2700 Points
547 Posts
Microsoft
Re: can't compile in Web Application Project
Nov 29, 2006 05:02 PM|LINK
This posting is provided "AS IS" with no warranties, and confers no rights.
tim_mackey
Member
54 Points
19 Posts
Re: can't compile in Web Application Project
Nov 29, 2006 05:21 PM|LINK
hi polita, thanks for the reply.
it is a design-time problem at least, and since it can't compile (WAP) i can't get check how it would go at run-time.
i'm using the exact same web.config that blinq generated, with the same 'bin' folder contents, it is marked as an application in IIS but as far as i know VS doesn't pay attention to that for WAPs. I wouldn't worry too much about it because VS has plenty of bugs relating to web application projects, intellisense, designer support etc., that i am hoping will be largely sorted out with the release of SP1, although the beta wasn't too inspiring.
i've started using Web Projects again and i can live with it no problem, it sounds like more of a VS/WAP problem than anything wrong with Blinq itself.
if you'd like to follow it up further i can forward you the solution no problem, but it sounds like everything is fairly busy on the asp.net team!
thanks
tim.
phuff
Contributor
2700 Points
547 Posts
Microsoft
Re: can't compile in Web Application Project
Nov 29, 2006 05:29 PM|LINK
Tim, I apologize for the problems you're having with WAP and VS. Having two web project paradigms has been a challenge for our team, and we haven't always handled it in the best way. I understand that this is frustrating for our customers.
I will reply to you privately to get your project files so I can try to repro your problem.
This posting is provided "AS IS" with no warranties, and confers no rights.
LurkingVaria...
Member
74 Points
43 Posts
Re: can't compile in Web Application Project
Jan 20, 2007 05:05 AM|LINK
What was the outcome of this? Is Blinq compatible with WAP?
Thanks,
-LV
tim_mackey
Member
54 Points
19 Posts
Re: can't compile in Web Application Project
Jan 21, 2007 08:58 AM|LINK
hi, it doesn't appear to work in the current release of VS 2005 / Orcas May CTP. there's a good chance it will work with the coming releases of VS 2005 SP1 (for vista) and the February CTP of orcas. it does work fine as a web project in VS so i have adopted that project model just for these projects.
tim
LurkingVaria...
Member
74 Points
43 Posts
Re: can't compile in Web Application Project
Jan 21, 2007 05:38 PM|LINK
Bummer, I do love my WAP. What is your overall impression... was it worth ditching WAP to develop with BLINQ?
Thanks,
-LV
tim_mackey
Member
54 Points
19 Posts
Re: can't compile in Web Application Project
Jan 22, 2007 11:27 AM|LINK
in my situation, the great discovery of Blinq was Linq and SqlMetal, which i had never used before. the user interfaces that blinq produces are certainly an achievement in terms of code automation, but the lack of type validation in the DetailsView control, and lack of fidelity to the sql table schema (e.g. allowing null values or not, setting maxLength of TextBox controls to match the column field size etc), make it impractical out-of-the-box IMHO. currently i use Blinq purely for the 2 code files it generates, StaticMethods.cs, and of course the SqlMetal DataContext class for the database. i use my own code generator tool for the front-end.
blinq is also a great example of what is possible with Linq and i have learned a lot from the techniques used in the blinq code.
to answer the question... yes it's definitely worth ditching WAP, at least for a few months until they iron out the 'VS mess', hopefully with the release of SP1 for vista. VS 2005 has turned into a beast IMHO, it often takes about 20 minutes to install a simple add-on. why didn't they just go for an Xcopy deployment with a "plugins" folder? that's probably horribly simplistic, but i think i'm not alone in saying that we are all far too experienced at uninstalling and reinstalling VS, and of course all the nonsense about having to install various components in an exact order. e.g. SQL 2005 report designer etc. it is a great product, and i'll never go back to notepad obviously, but i think i've earned the right to rant about it at least :)
LurkingVaria...
Member
74 Points
43 Posts
Re: can't compile in Web Application Project
Jan 22, 2007 08:59 PM|LINK
Thanks for the in-depth response. When you say "my own code generator tool", do you mean one you wrote from scratch (wow) or just something other than BLINQ?
TIA,
-LV
tim_mackey
Member
54 Points
19 Posts
Re: can't compile in Web Application Project
Jan 22, 2007 10:10 PM|LINK
hi, yes i did write one from scratch, but it isn't all that amazing really. all the web apps i develop have some similarities and i see it as a labour saving device more than anything else. i've read that many people have some sort of code generator tool they've worked on over the years. there are lots of free ones and commercial ones, but i wanted one that was not too hot or too cold, one that is 'just right'. i'm quite pleased with it.
for example, taking a stored-procedure (schema extracted from the sql database via the SMO API), it will generate a fully functional aspx front-end page for that stored procedure, along with code behind to handle the updates and initialisation, making good use of the SqlMetal generated strongly-typed methods for executing the stored procedure. it's really not rocket science, and my approach is quite basic, iterate through all the columns included in the stored procedure, if not nullable then add a requiredfieldvalidator, if datetime then add a DatePicker control, else if numeric then add a regularexpressionvalidator, if it's a foreign key column then render a dropdownlist instead, databound to the foreign key table, otherwise just render a textbox etc. loads of if/else code basically, but it works just the way i like it and it means i can roll out data-driven web apps very easily. it takes the donkey work out of development. as an example of what i mean by donkey work, consider how much effort we put into designing the database first, specify a column to have a max size of say 50 chars, but then we have to go into the aspx as well to the corresponding textbox for this field, and manually set the MaxLength to 50? and hook up required field validators when we already set the database field to non-nullable? it shouldn't need to be done twice, and tooltips as well, i always set column descriptions in the table schema, and my tool makes sure to pick these up and use them automatically for tooltips.
i think there are much more elegant implementations out there which actually use the language grammar to generate the code. i just use a stringbuilder and output the result to screen, or a tmp file etc. if you do loads of programming, and you spot patterns to what you do, it's very easy to write a few scripts that do the work for you. i have found it to be very worthwhile.
tim