473,661 Members | 2,453 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subject: about automatic execute code in design time

Hi,
I'm new to vb.net.
How to prevent vb.net to automatic execute code in design time?

When I open a form design view in VS2005, vs pop up an error message: "Could
not load file or assembly "xxx" or one of its dependencies... .". But there's
no build error, and can run normally.The renferenced assembly(not strongly
named) do exist, but not in GAC.

I wonder there's any way to disable the error check when I open the form?
And why the result can run, but VS2005 throw error in design time.

Thanks a lot.

Nov 5 '07 #1
2 3482
On Nov 4, 7:44 pm, Freeman <Free...@discus sions.microsoft .comwrote:
Hi,
I'm new to vb.net.
How to prevent vb.net to automatic execute code in design time?

When I open a form design view in VS2005, vs pop up an error message: "Could
not load file or assembly "xxx" or one of its dependencies... .". But there's
no build error, and can run normally.The renferenced assembly(not strongly
named) do exist, but not in GAC.

I wonder there's any way to disable the error check when I open the form?
And why the result can run, but VS2005 throw error in design time.

Thanks a lot.
You can't do it in the constructor - but, if you move this
initialization stuff to form_load, then you can test for design mode
before you attempt to access those resources:

Public Sub Form1_Load(ByVa l sender As Object, ByVal e As EventArgs)
Handles Form1.Load
If Not Me.DesignMode Then
' Access Your Resources
End If
End Sub

--
Tom Shelton

Nov 5 '07 #2
Thanks for you answer.

I'm sorry I did say clearly.
I do initialization in form_load. But the form contains several user
control, and it seems that the control_load would be execute
automaticly(cal led by InitializeCompo nent()). How to prevent this? Remove
auto generated code in InitializeCompo nent() related to user controls?

"Tom Shelton" wrote:
On Nov 4, 7:44 pm, Freeman <Free...@discus sions.microsoft .comwrote:
Hi,
I'm new to vb.net.
How to prevent vb.net to automatic execute code in design time?

When I open a form design view in VS2005, vs pop up an error message: "Could
not load file or assembly "xxx" or one of its dependencies... .". But there's
no build error, and can run normally.The renferenced assembly(not strongly
named) do exist, but not in GAC.

I wonder there's any way to disable the error check when I open the form?
And why the result can run, but VS2005 throw error in design time.

Thanks a lot.

You can't do it in the constructor - but, if you move this
initialization stuff to form_load, then you can test for design mode
before you attempt to access those resources:

Public Sub Form1_Load(ByVa l sender As Object, ByVal e As EventArgs)
Handles Form1.Load
If Not Me.DesignMode Then
' Access Your Resources
End If
End Sub

--
Tom Shelton

Nov 5 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
822
by: jackson | last post by:
In an ongoing effort to reduce the flood of emails I receive every day, I've initiated this automatic response email. If your email was concerning any of the following subjects, then this automatic email will serve as my response. First, please read the FAQ at http://www.wsgforum.com/forumfaq.html. The FAQ has the answers to 62 frequently asked questions covering a large range of subjects regarding the forum and it's operation, and in fact...
0
1374
by: AMDIRT | last post by:
I have a few questions about IssueVision (from WindowsForms) concerning its scalability and performance. Rather, if I were to implement techniques described here into another application, how would it perform, how well will it scale, and what considerations should I be take into account? First, let me say that I appreciate the work done to get this application out there for me to look over. I continually refer to it and I think I am...
6
10235
by: Matt | last post by:
I have begun designing and programming in C++ after a several years away from software engineering/programming. I am looking for an "automatic C++ header generator." I have what seems to be fairly simple requirements: 1) command-line oriented tool 2) input .cpp files, output .h files 3) do not change the .cpp files if directed
5
2367
by: Shane | last post by:
I wonder if someone has any ideas about the following. I am currently producing some reports for a manufacturing company who work with metal. A finished part can contain multiple sub-parts to make up the finished part. The sub-parts can also be made up of sub-parts and those sub-parts can also be made up of sub-parts etc etc. All parts are contained within the same table and I have a seperate table
7
1763
by: Lucas Sain | last post by:
Hi, How can I make a code in an event not execute in design time. I have a Baseform that has X code in the event "VisibleChanged". All my forms inherit from this form. The code in this event always gets executed in design time, how do I avoid this?? Regards Lucas
75
5602
by: Sathyaish | last post by:
Can every problem that has an iterative solution also be expressed in terms of a recursive solution? I tried one example, and am in the process of trying out more examples, increasing their complexity as I go. Here's a simple one I tried out: #include<stdio.h> /* To compare the the time and space cost of iteration against
4
2523
by: Petterson Mikael | last post by:
Hi, Anyone out there that knows of a automatic test generation tool for cpp? Another requirement is that the test results should be presented in xml. All hints appreciated. cheers, //mikael
0
312
by: JoshforRefugee | last post by:
heard that we can do automatic code generation using macros, but not sure how can I pursue this. Here is my problem. In my env, I have class A,B and C. All of them has constructors, and few common methods, like reset, and execute. now my env(main) class actually is where I am creating this objects. in .h A myA; B myB;
58
4644
by: Jorge Peixoto de Morais Neto | last post by:
I was reading the code of FFmpeg and it seems that they use malloc just too much. The problems and dangers of malloc are widely known. Malloc also has some overhead (although I don't know what is the overhead of automatic variable sized arrays, I suspect it is smaller than that of malloc), although I'm not too worried about it. I was thinking that, with C99's variable length arrays, malloc shouldn't be needed most of the time. But I'm...
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8855
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7364
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4346
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1743
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.