C# - Using Types In A T4 Template That Exist In The Same Project As The Template?
Aug 4, 2010
I'm working on my first T4 code generation tool to add some Stored Procedure helper code to my project. I've created custom types (e.g. StoredProcedure and StoredProcedureParameter to help with my code generation and have included the assembly and namespace references in my code:
<#@ template debug="false" hostspecific="false" language="VB" #>
<#@ output extension=".generated.vb" #>
<#@ assembly name="$(TargetPath)" #>
<#@ import namespace="StoredProcCodeGenerator" #>
This allows me to use my custom types in my T4 template code. However, because my custom types exist in the same project as the T4 template code, I can't recompile my project once I run the template code without restarting Visual Studio. This isn't very much fun.
I read a great article that addresses this exact issue by using the T4 Toolbox, but it's not working. Either I'm implementing the VolatileAssembly directive wrong or the T4 toolbox simply didn't get installed. I'm not sure that the toolbox got installed correctly (I'm using VS 2010 on Win XP).
View 3 Replies
ADVERTISEMENT
Aug 20, 2011
In VB.NET,I want to create template at runtime and save it the template with name. for ex : Administrator design a page with 5 fields like using firstname, lastname, dob,nationality and job. He want to assign this page to the user with some restriction like user1 need to enter the all the fields and save it the forms as user1profile, but user2 need to enter only firstname and lastname and save it as user2profile.(in features, he can remove the fields from the form).
View 1 Replies
Nov 5, 2009
I want to change the defaults of setup project, (ex. installallusers to true, it comes with false). Any one know where is the setup project template, so I can change it
View 6 Replies
Apr 3, 2010
After installing Monobjc and playing around with the Monobjc Application Project under C# in MonoDevelop, I noticed that there is only an empty Monobjc project under the VB section.
Obviously this template adds all the correct references but doesn't add the basic files for the application to run. I've tried creating a class with:
Imports System
Imports Monobjc
Imports Monobjc.Cocoa
Class Application
[Code]...
Also if I add in a xib file from IB, how do I generate the designer code for the partial AppDelegate class?
View 1 Replies
Apr 27, 2009
I was at a class recently, and the instructor started a new Visual Studio 2008 project using a "COM project" template. Now that I'm back, I tried finding that template in my installation of VS2008 with no luck. Does anybody know where I can find that template, or failing that, what it might be doing to achieve its effect?
View 2 Replies
May 6, 2012
IDE :: Project Template Awareness for Auto-Generated CodeE
View 2 Replies
Jun 17, 2010
I am trying to write an add-in into the SSMS 2008 R2 IDE. I believe it is possible, though maybe not fully supported by Microsoft. I have created a new project in Visual Studio 2010 of type Extensibility - Visual Studio Add-in. This has created my project and all of the relevant code to get the add-in loaded onto the Tools menu. The only line of code I have added is in the OnConnection method to display a messagebox so I know it has at least loaded.
When I build this as is, it will load as an Add-in into VS 2010 onto the Tools menu - which is fine - at least part is working. But when I try to add this as an Add-in into SSMS 2008 it keeps giving me the error message:The Add-in 'DataFollower.Connect' failed to load or cause an exception. Would you like to remove this add-in? ... Error Message: No such interface supported.
Below is a top half of the code in question. This code was created directly from the VS Add-in template - nothing has been altered. The error occurs on the line:
_applicationObject = CType(application, DTE2)
This is running on a Windows 7 64bit machine, SQL 2008 R2 64bit and VS 2010.
Imports System
Imports Microsoft.VisualStudio.CommandBars
Imports Extensibility
Imports EnvDTE
[code]....
View 1 Replies
Aug 8, 2011
I am just starting out on VB so this is a very elementary question. If I want parse a file and store results in a csv format, which template do I use? Console Application? Empty Project?
View 1 Replies
Nov 9, 2009
I would like to have windows CE devices available and am unable to see how to select that option.
Under tools > options > device tools - Windows CE device is listed.
I'm new to this and unsure how to do this. I created a project, but it's not right for windows ce and does not deploy.
Do I need a windows ce template or how can it be selected under new project?
View 3 Replies
Mar 22, 2011
I have been working on a inventory management system for a friend of mine. It has to be able to keep track of incoming and outgoing stock from his business.
I have already got all the programing done, working great! But now it has got to the stage, that I need the program to print out invoices from the program. I have the program extract certain records from an attached database, and will most probably pass them into a variable in the function.
NOW... I have a template of the tax invoice page setup in MS word. I was going to make a macro in word that will automatically fill in all the "static" information, but I was wondering if passing the variables from the main program into the word macro is: 1. possible and 2. the best way of doing this.
I am still a noob when it comes to VB so please excuse the next question, but is there a way to set up a page to be printed including tables, logo, different font styles.. etc within the VB program?
View 5 Replies
Apr 18, 2010
I managed to export my data to an excel file, by using a excel template that I created beforehand. But I'd rather have that the excel file will be create when I press the button instead going to my file.
Dim ApExcel As Object
ApExcel = CreateObject("Excel.application")
ApExcel.Visible = True
[Code]....
View 2 Replies
Jul 24, 2008
On creating a new project in Visual Basic 2008 Express Edition (Version 9), where you get to choose a template, I can't find Standard EXE anywhere.
View 5 Replies
Nov 21, 2009
I'm making a signup application to go along with a website I'm making with HTML. I've already made one version of it with a WPF Browser application template, but it's not working the way I'd like it to. Is this the template I should be using or should I make it in the generic windows form application?
View 1 Replies
Jan 31, 2011
I am using Visual Studio 2008 Express, and I was wonder which Visual Studio Installed Template I should use just to execute VB code? Previously, I generated a project using Window Form template with a button to start, and it has references which made my .exe not to execute in any directory structure. Someone indicated that it must not have other absolute references and I think this was using absolute references? All I need to is to execute VB Code. What template would you suggest? Where do I put the start of the VB program to execute at? Since I don't need a form, there is no on event for me?
View 6 Replies
Jul 18, 2010
I'm trying to create my own templated helpers but I got stuck on TextBoxFor syntax. In C# its:
<%= Html.TextBoxFor(model => model) %>
And I cannot figure out (or google it) - how to write that in vb.net?
View 2 Replies
Dec 22, 2009
Try5Times will try a function for 5 times.that function can have any number of argument and return a boolean.
If the function return false, try again.
If the function return true, stop.
How to make such function and delegate? Is there a general delegate?
View 3 Replies
Oct 30, 2009
I want to develop an app with custom forms. When I finish to create a custom form, how can I set this form as a template? I want to select this form from the templates, when I add a new form to my project.
View 3 Replies
Jun 11, 2011
I've done a lot of work to customize the template for ContextMenu in my app, and it worked great as a "right-click" popup window.To my enormous surprise, when I wanted to add the same ContextMenu to a button to work as a kind of "drop-down" menu, it reverted back to the default template. It is really, really, weird, considering it's the exact same control I'm using, and when I right-click the button the template is the one I customized, but when I left-click it(and open it with ContextMenu.IsOpen = True) it uses the default template? I'm pretty baffled right now, and hope that this isn't one of the (many) quirks with WPF that will require me to write hundreds of lines of XML code to fix something that shouldn't even be an issue in the first place.
View 3 Replies
Oct 29, 2010
How do you deserialized a serialized object?I'm trying to extract the serials of fingerprint template which will be stored to the database. Here is my
Dim features As DPFP.FeatureSet = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment) <--- Serialized Object
And here is my sad failure attemp:
SetText(String.Format("Stat: {0}", features.DeSerialize(WHAT SHOULD I PUT IN HERE????)))
View 1 Replies
May 26, 2011
I have a an excel file that has been manually populated, and now needs to be automatically populated using ASP.NET, vb or c#. I've been looking around, and have found examples on how to export a gridview, and data to excel sheet, but not anyway to maintain the format of the original template. I've recently populated a word document using merge fields... does excel have anything similar? Could I break the file down into XML and use that as a template?
View 1 Replies
Sep 3, 2010
I have a gridview that I would like to be able to bind to several sqldatasources, but still use template fields. Each datasource is different and would have different columns so I'm not sure how to go about this. Is it possible to define a set of template fields or overlying template per datasource?
View 2 Replies
Sep 15, 2011
I'm writing some project management software for a buddy of mine. He has some Word Template files that he uses to create his actual contracts to be signed. I'm trying to find a way in .NET to extract the contract data from SQL Server and use that data to automatically create the Word files for each project with the Template Data filled in.
View 10 Replies
Oct 27, 2011
how do I open a document from template in VBA?
View 3 Replies
Nov 9, 2009
i used mygeneration to generate my code,but i found that the template editor is awful, and i dont have any substitution.do u have any ideas? or better generator?(no CodeSmith, it is commercial)
View 1 Replies
Mar 30, 2010
1) VB Allows non-type template parameters
2) VB supports explicit specialization
3) VB allows the type parameters to be used as the base class for the generic type
4) VB allows a generic type parameter itself to to be a generic
5) VB enforces that all codes are valid for all types of parametrs what would be the Best Choice ?
View 4 Replies
Mar 1, 2012
In the RowDataBound event of an ASP.NET Gridview I am trying to read the value of a Label in a Template Field. I would prefer to capture this value in the RowUpdating Event, but for some reason I seem to recall that it is not possible. Here is the ASP...
<asp:TemplateField HeaderText="Translation" ItemStyle-Width="250" >
<ItemTemplate>
<asp:Label ID="Label11" runat="server" Text='<%# Bind("lang_String") %>' Width="250px"></asp:Label>
</ItemTemplate>
Here is the VB.net code that I am trying to figure out....
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If (e.Row.RowState And DataControlRowState.Edit) > 0 Then
[code]....
View 1 Replies
Jan 23, 2012
I try an update but I get an error"The Index was out limits.I shouldn't be negative and should be smaller than size of the collection" This concern this line in debug "Dim courseId As String = gridViewCourse.DataKeys(e.RowIndex).Values("CourseId").ToString()" This my grid asp code
[Code]...
View 1 Replies
Apr 14, 2012
I would like my website to allow users to download files which are stored as blobs on the database, the database holds fileID fileName and theFile. I have a grid view with two columns, fileName and a template column, which is databound to fileID and has a linkbutton. When the link is clicked it calls to a function which downloads the file. The function needs the fileID to download the file, how do I get the fileID bound to the selected linkbutton.
View 1 Replies
Jun 15, 2010
I know this is really picky, but can I have one template inside a user control:
<uc:MyUserControl runat="server" ID="test">
<div><b>Test</b></div>
<asp:PlaceHolder runat="server" id="pH" />
</uc:MyUserControl>
Instead of what I have now which requires me to:
[Code]...
View 1 Replies
Aug 17, 2011
How can I move the .cs or .vb files generated by a T4 template to another folder of the project in visual studio 2010.
View 2 Replies