Compiler Slow On A Large Solution With Extension Method Project

Nov 13, 2009

I'm working on a larger VB application (framework v3.5) where the compile time continues to get slower and slower the larger it grows. It currently takes about 7 minutes to compile just the extensions project. We have other similar projects in C# that don't experience the slow compile time.

View 1 Replies


ADVERTISEMENT

.net - Can The Select Extension Method Project To A List Of Instantiated Objects

Mar 24, 2011

I have two lists declared as follows:

Dim lstDBItems As New List(Of DBItem)
Dim lstAppItems As New List(Of AppItem)

I am trying to do something like this:

I've a function which returns List(Of AppItem):

Function GetAppItems() As List(Of AppItem)
'...
End Function

In the above function I populate lstDBItems and then write the return statement like follows:

Return lstDBItems.Select(Function(x)
dim oItem As New AppItem()
oItem.Property1 = x.DbProperty1

[Code]....

The weird thing is the code compiles, but on rumtime I get a type case error.

View 3 Replies

Use System.Linq Extension Method In Project With Option Strict ON?

Feb 2, 2011

I'm using .NET 3.5 In my DataLayer class I have references of System.Core,System.Data.Linq, System.Data.DataSetExtensions. But I cantnot use this feature in Linq query if I have Option Strict ON:

[Code]...

View 1 Replies

Obsolete Codedom Compiler New Method Of Compiler?

Nov 11, 2010

Imports System.CodeDom.Compiler
Public Class iCompiler
Public Shared Sub GenerateExecutable(ByVal Output As String, ByVal Source As String, ByVal Icon As String)[code].....

View 4 Replies

Use An Extension Method Instead Of Just Creating Non-extension Sub Or Function?

Dec 3, 2009

Why would I use an extension method instead of just creating non-extension sub or function?

For ex, I could have an extension function called IsNullOrEmptyOrAllSpaces on String, which does a check as its name implies. Or I can write a stand alone function that does the same thing. Other than having the extension show up in Intellisense, is there any advantage? Is a call to the extension quicker/more efficient than a call to a regular function?

View 8 Replies

VB Extension Property Instead Of Extension Method

Mar 16, 2012

I saw this post and I want to know if this is possible in VB. So like extension method, do extension properties exists in VB.Net? Here I've read they do, but cannot find any examples.

View 3 Replies

VS 2008 - Timer - Project A References Project B So Can Open A Large Form In Project B

May 5, 2010

For reasons that are beyond my control, I have three Projects. Projects A and B reference project C. Project A references project B so that it can open a large form in project B. I now need to open that large form from project C, but VB won't allow me to add a reference from C to B because that would create a circular dependency. I found a way around it, though. I created a Timer in A, and when I opened C from A, I passed in that timer. When the user performs a certain action, I enable the Timer from A, and this causes C to open B for me.

View 2 Replies

Constrain A Generic Method / Extension Method To Numeric TYPEs Only?

Sep 16, 2010

Write an overload for every numeric type or if possible constrain a generic extension method to just numeric types.

View 2 Replies

Slow Form Load (has Large Number Of Controls)

Nov 9, 2010

I wrote last week about a problem with an MDI program that had a large number of forms (each with a large number of controls on it) that was "sluggish" in loading and in switching between the child forms.I've attached an example program in VS2008 (though the actual app is VB2010)Rather than show the hardware control application with all of the text fields, and picture boxes acting as indicators, I made a simple program to show the point. This is exaggerated as this just loads 2000 or so text boxes on a form. In the real app I have ~ 200 assorted controls per form of picture boxes, scroll bars, text boxes, labels etc. Also, there is a large full screen .jpeg as the back ground of each form. All are generated at run time and are placed on the form in the New call of each form. (as in the sample attached)main issue seems to be the methodology I use to switch between child forms. I make the current form .visible = false, and the next.visible = true. I have used this as it "keeps the place" on each page if the user has scrolled or is looking at one section of the form. When the next form .visible = true happens I see the controls added in a "machine gun" fashion instead of all at once.

View 28 Replies

Determine Whether A Method Is Declared Normally Or As An Extension Method?

Jul 16, 2010

Extension methods are useful for types that you don't own and can't/don't want to derive from and extend (e.g. reference types and interfaces). Obviously, interfaces should be kept as short and to-the-point as possible, so extension methods for interfaces are particularly useful (e.g. LINQ).For classes, especially classes that you own, they're still useful - but I'm wondering how you determine what should be an extension method or what should be a method in the class itself.Personally, every time I think about it, I keep going round in circles with the following thoughts:If it's useful enough, it should be in the class.It's not part of the core responsibility of the class, it should be an extension method - but if it's useful enough, surely it should be the responsibility of the class...

View 3 Replies

IDE :: IntelliSense Slow When List Filtering Large DataSet Hierarchy

Nov 21, 2007

I just converted my project from VS 2005 to 2008 and started getting really bad lag only when intellisense iterates my dataset objects. The cpu maxes out one of my cores for about 2-3 seconds each time the intellisense list pops up. Is this a new feature of the 2008 ide?

View 19 Replies

VS 2008 Best Way To Display Large Text Files/Slow Controls?

Mar 24, 2009

I am new to VB.Net, but I can tell you so far I love programming. That said, I'm building a tool basically to parse and display simple plain text log files. I'm hitting one stumbling block that really has me frustrated.

Other tools are able to load huge log files (500MB even) in a number of seconds. My tool, basically hangs loading a file that is maybe 5MB.

I'm using the MyString = StreamReader.ReadToEnd to read the contents into a string, and then RichTextBox1.Text = MyString to display the contents. That said, I really want to display the contents in a datagrid, but there has to be a better way of doing this?

How can I get my application to load larger files and display them faster? What am I doing wrong?

View 7 Replies

C# - OutputDataReceived (and ErrorDataReceived) Has A Slow Firing Rate And Creates A Large Buffer?

Nov 5, 2010

is there a way to increase the rate a Process object in .NET throws the OutputDataReceived event? It creates a large buffer (I believe 1024 characters) that is dumped in bulk which makes the application not as fluid of a stream as I would of like it to be.

View 1 Replies

C# - Project To Project Reference Specific Version In Same Solution

Jun 7, 2012

I'm developing application that is plugable. The plugins are loaded via Assembly.LoadFrom(). In my solution I have 4 projects. A WPF, 2 DLL and another DLL that is a plugin for the app. The plugin project references one of the other DLLs. When I build the Solution and run I was getting an error trying to use the plugin dll because it was expecting an older version of the referenced project. I had to clean and rebuild the plugin project to get it to run correctly.

[Code]...

View 1 Replies

Variable Inside A Method Is Compiler Generated

Aug 24, 2010

Is there any way to know that a variable inside a method is Compiler generated.when decompiling a .net dll or exe the generated code looks like this. [code]

View 8 Replies

Call The Function And The Compiler Error Went Off When Get A Return Value From That Method?

Mar 11, 2009

I'm using VB6 and trying to get an instance of a Type Library object.After i retrieved the object and i'm trying to invoke a method. I'm getting this exception. However, i've checked with the parameters and its type. it is correct.I found something fishy, that method doesnt have return value. But it is throwing a compiler error whenever i'm trying to call the function and the compiler error went off when i get a return value from that method.I don't know,

View 1 Replies

Compiler Conditions And Project References?

Jun 15, 2009

I've recently started running into DotNET difficulties with newer HP and Dell systems that are pushing x64 processors and operating systems onto a totally unaware end-user market, so suddenly a lot of work I've done in VB.NET is going to ____ in a handcart; specifically all the work I've done with 3rd Party tools that are only available in x86 or x64 builds and not DotNET Native builds for any CPU. The biggest problem is that all the DLL File Names, in-code Namespaces, Classes, and Methods are totally identical - just one version is compiled for 32 bit and one for 64. What I need to do to fix this is provide some #If compile conditions that alter the paths of existing references based on the Build Configuration, so that when I'm compiling for the x86 platform it references C:DBAPISQLitex86System.Data.SQLite.DLL but when compiling for x64 it references C:DBAPISQLitex64System.Data.SQLite.DLL.

I don't have a problem writing compile conditions, but can't figure out how to alter the reference paths before the compile begins, short of manually removing one reference and adding the other every single time I need to do a dual-platform compile.

View 1 Replies

See The My.Settings Of One Project From Within Another Project Within The Same Solution?

Sep 30, 2011

is there a way to see the My.Settings of one project from within another project within the same solution?I'm guessing the answer is no, they are scoped at the project level

View 3 Replies

How To Add Extension Method

Apr 10, 2010

I know how to add extension method Like (Date.Now.MyExtensionFunction()),But I can NOT find how to add such methods and functions in class (not in module) with vb.net

View 3 Replies

2008 - Why Does The VB Compiler Crash After Move A Project

May 21, 2009

I'm migrating data from an old laptop to a new laptop, including some vb.net projects in visual studio 2008. But when I try to open some of them on the new laptop, I quickly get a dialog stating that the vb compiler has crashed and asking me if I want to close, debug, or check online for solutions. Visual studio then, frustratingly, closes.The projects don't crash when opened on the old laptop, and other migrated projects open without crashing. So it must be some property of the projects that becomes corrupted by moving them.

Error Details:

Problem signature:
Problem Event Name: APPCRASH
Application Name: devenv.exe
Application Version: 9.0.21022.8

[code].....

The old laptop is windows xp and uses visual studio professional. The new laptop is windows vista and uses visual studio team. The 'migration' was a straight copy paste of the source files.

View 2 Replies

Limit :: Way To View All Compiler Warnings For A Project?

Nov 25, 2009

VB.NET has this rather annoying limitation which caps compiler warnings reported at 100.vbc : warning BC42206: Maximum number of warnings has been exceeded.This makes things rather frustrating when trying to size up the amount of effort that would be required to comply with VB.NET best practices, such as enabling Option Strict.

View 2 Replies

VS 2008 Open Project, Compiler Crashes?

May 21, 2009

I'm trying to move a project from my old laptop to my new laptop. But I'm running into a problem: whenever I open the project on my new laptop, it crashes!I can open other projects on my new laptop, including some copied from my old laptop. I can also open the project in question on my old laptop. So the problem must be some combination of things in the project, and the fact that it was moved

View 4 Replies

Adapter.Fill (ds)Method Is Slow?

Mar 2, 2010

rsReturn = New DataSet()
objCommand.CommandTimeout = 240
Using objadapter As New OleDbDataAdapter(objCommand)

[code].....

View 2 Replies

Load Method Of A Datatable Sometimes So Slow

Jun 27, 2011

The project is a web app in ASP/VB.net. The issue is that some pages are mind-boggingly slow. After trying to track down the bottleneck, it was discovered to be the load method when filling a datatable with query results.

We are using an Oracle database and queries are executed in stored procedures. As an example, we have a relatively simple select statement within a procedure which returns 2 columns with 6 rows which was determined to take about 0.015 seconds to execute. However it takes on average 7 seconds to load the OracleDataReader into a datatable - a ridiculous amount of time for such a small record set. After messing around with the query, I found that a simple decode statement appeared to be causing the issue. The decode statement is used similar to as follows[code]...

The iBln variable is simply a number being passed in to act as a boolean variable for determining which column should be between two dates. If I comment this decode statement out and make it simply "column1 BETWEEN iDate1 and iDate2" then the load method takes no time at all as it should, signifying that it is indeed the decode statement causing issues.

View 2 Replies

Slow Fill() Method Of Sqldataadapter?

Jan 19, 2010

I fill a dataset using fill() method of sqldataadapter. The select query call a user defined function in it. My problem is that when I run this query in sqlDataAdapter , the fill() method take about 70 Sec. to give output but if I run the same query in Enterprise Manager or in Query Analyzer it gives output within a 1 or 2 Sec.

View 2 Replies

Compiler Creates Culture Folders For A Not Localized Project

May 31, 2012

I have a winform application written with vb2010.I changed the "Language" property of a winform of my application to german, only for testing purpose. I built the application and in my indebug folder it was created a new de folder with the localized resource file "appname.resources.dll". Then I set back the "Language" property to (Default) and "Localizable" to FALSE and built again the application, but the de folder with its appname.resources.dll were created again. I have controlled each form in my application, the My Project setting too,nothing points to any other culture. I deleted the whole debug folder, but after each build, I get always the de subfolder.I cannot understand what is changed in my application now: why does the compiler create a localized resource if I set back the form properties?I repeated the same for a new culture (afrikaans), to discover any changes in the form properties: I found nothing that could help me, but now I get two subfolders.: de and af

View 5 Replies

Asp.net - Error With Extension Method In .NET?

Mar 26, 2012

I am trying to write extension methods in VB.NET

Imports System.Runtime.CompilerServices
Module ExtensionMethods
<Extension()> _

[code]....

But I am getting this error.Class 'System.Web.UI.WebControls.ListItem' cannot be indexed because it has no default property

What could be wrong?I am calling the code like this.

ddlSalesmanager.Items.FindByText(survey, StringComparison.CurrentCultureIgnoreCase)

P.S: I ported this wonderful code from C# to VB

View 1 Replies

Calling A VB Extension Method?

Feb 23, 2012

I converted some code from c# for a VB.net project I have an object declared as this :

<Serializable()> _
Public Class oUserApplication
Public ApplicationID As Integer = 0
Public ApplicationRoleID As Integer = 0

[code]....

View 3 Replies

Extension Method In View Using ASP.NET MVC?

May 18, 2009

I ran into a strange issue over the weekend while I was working on an asp.net mvc project in vb.net. I created an extension method to convert an integer to the corresponding month it is associated with. I tested the extension method in a console application so I know it is working.

In my asp.net mvc project I have a view and want to call the extension method but I get an error that the extension method is not recognized. I imported the namespace it was contained in and still couldn't shake the error.

Extension Method:

Imports System.Runtime.CompilerServices
Module SiteExtensions
<Extension()> _

[Code].....

View 3 Replies

Implement An Extension Method?

Nov 10, 2010

I want to implement an extension method in VB.NET that will clone an object of type T.Say, I want

Dim cust1 as New Customer() //...
Dim cust2 as New Customer() //...
cust2 = cust1.Clone()

[code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved