Click here to Skip to main content
       

Visual Studio

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
Questionvs2010 referencesmemberMember 788865920 May '13 - 23:13 
Hello all,
 
I'm having some headache with my project references.
 
First off all, I have a common library which uses 3rd party .NET librarys. Now, the problem is that all these 3rd party dll's come from one program that needs to be installed on the system for my application to work. But still, vs2010 copys the dll's into it's output directory and uses those copys instead of the dll's located in the program folder of the 3rd party program. (Are you with me, I know my english isn't top of the notch) How can I prevent this, so that vs2010 doesn't copys those dll's again, and that my app will use the original dll's?
 
Is it possible?
 
The next problem I have, is that in my application, I use a usercontrol from my library that uses a 3rd party dll. And for some reason I really need to add that 3rd party dll to my application references allthough my library already references that 3rd party dll. Can I change this behaviour? So that referenced dll's from my library don't need to be referenced in my application itself?
 
I hope that my questions are clear,
Thanks in advance!
AnswerRe: vs2010 referencesprofessionalSimon_Whale21 May '13 - 0:03 
have a read of this Take advantage of Reference Paths in Visual Studio and debug locally referenced libraries[^]
Every day, thousands of innocent plants are killed by vegetarians.
 
Help end the violence EAT BACON

GeneralRe: vs2010 referencesmemberLMG7021 May '13 - 21:29 
Thanks! This sounds really helpfull Smile | :)
 
I have a question though, Say that I use this approach and on my development machine I have V1 of the 3rd party libraries, but on the customers machine, V2 of the 3rd party libraries are installed. Will that cause problems? (Let's presume the API is the same, the new version has only bug fixes and other enhancements)
 
Because now I have a bindingredirect of a 3rd party dll in my app.config, that says, whatever version you think you need, use V1.
Can this be changed to: Whatever version you think you need, use the version installed on this system?
GeneralRe: vs2010 referencesprofessionalSimon_Whale21 May '13 - 22:06 
As far as I am aware, It will happily use what ever version of the 3rd partly library that is installed at that location. But you have to make sure that the functionality is available in the libraries that are installed on the local PC.
Every day, thousands of innocent plants are killed by vegetarians.
 
Help end the violence EAT BACON

QuestionSecurity featuresmemberJames R Opdycke II15 May '13 - 16:33 
I was tasked in my schooling with adding security features to a calculator code we wrote for a previous project. I have never used security features before and have not the first idea how to incorporate them in my project. We apparently have to add them to our functions (plus, minus, multiply, divide). I'm not asking for anyone to do the work for me but I could use help with what exactly needs to be done.
 
The following is an example of the code for the button that divides:
 
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles divNum.Click
        ansBox.Text = (Integer.Parse(numBox1.Text) / Integer.Parse(numBox2.Text)).ToString()
    End Sub
 
If more of the program is needed or anything just let me know. Any help would be amazing!
QuestionRe: Security featuresprofessionalRichard Deeming16 May '13 - 1:27 
What do you mean by "security features"?



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


AnswerRe: Security featuresmemberJames R Opdycke II16 May '13 - 11:35 
Here is my teachers exact wording of the assignment.
 
The GUI interface for your calculator now needs additional functions. To add security functions address the following in your Visual Studio file:
Program at least one of the functions (add, subtract, multiple or divide) in your calculator program to include a security feature.
An example of a security feature is to declare a variable as "private" as opposed to "public" (conduct some independent research if necessary to refresh on these topics).
GeneralRe: Security featuresprofessionalMatt T Heffron16 May '13 - 12:53 
Other than being in VB instead of c# I don't see anything to change in the code you've shown. Wink | ;)
 
Seriously:
From the wording, it looks like the issue is the accessibility of the various variables and methods in the implementation of your program. Make sure everything has the most restrictive accessibility (public/internal/protected/private) that still allows it to function correctly. Then look at things that aren't private and think about how you could redesign your code to reduce their "exposure".
 
I'd suggest you avoid modifying the accessibility of any code generated by the designer, lest you confuse the designer.
GeneralRe: Security featuresmvpRichard MacCutchan16 May '13 - 21:19 
As Matt says, this has nothing to do with security; it's a pity your teacher does not understand that.
Use the best guess

GeneralRe: Security featuresmemberJames R Opdycke II17 May '13 - 7:10 
He left this piece of python code as an example for the assignment but idk where in the code it has the security feature. From everything I have found all of my code says private on it so if that's what he wants it should have been already done lol
 
#!/usr/bin/python
 

#
from Tkinter import * # Download this from http://www.manning.com/grayson/
from tkMessageBox import * # Download this from http://www.manning.com/grayson/
 
# Calculator is a class derived from Frame. Frames, being someone generic,
# make a nice base class for whatever you what to create.
class Calculator(Frame):
 
# Create and return a packed frame.
def frame(this, side):
w = Frame(this)
w.pack(side=side, expand=YES, fill=BOTH)
return w
 
# Create and return a button.
def button(this, root, side, text, command=None):
w = Button(root, text=text, command=command)
w.pack(side=side, expand=YES, fill=BOTH)
return w
 
# Enter a digit.
need_clr = False
def digit(self, digit):
if self.need_clr:
self.display.set('')
self.need_clr = False
self.display.set(self.display.get() + digit)
 
# Change sign.
def sign(self):
need_clr = False
cont = self.display.get()
if len(cont) > 0 and cont[0] == '-':
self.display.set(cont[1:])
else:
self.display.set('-' + cont)
 
# Decimal
def decimal(self):
self.need_clr = False
cont = self.display.get()
lastsp = cont.rfind(' ')
if lastsp == -1:
lastsp = 0
if cont.find('.',lastsp) == -1:
self.display.set(cont + '.')
 
# Push a function button.
def oper(self, op):
self.display.set(self.display.get() + ' ' + op + ' ')
self.need_clr = False
 
# Calculate the expressoin and set the result.
def calc(self):
try:
self.display.set(`eval(self.display.get())`)
self.need_clr = True
except:
showerror('Operation Error', 'Illegal Operation')
self.display.set('')
self.need_clr = False
 
def __init__(self):
Frame.__init__(self)
self.option_add('*Font', 'Verdana 12 bold')
self.pack(expand=YES, fill=BOTH)
self.master.title('Simple Calculator')
 
# The StringVar() object holds the value of the Entry.
self.display = StringVar()
e = Entry(self, relief=SUNKEN, textvariable=self.display)
e.pack(side=TOP, expand=YES, fill=BOTH)
 
# Loop to produce the number buttons.
# is an anonymous function.
for key in ("123", "456", "789"):
keyF = self.frame(TOP)
for char in key:
self.button(keyF, LEFT, char,
lambda c=char: self.digit(c))
 
keyF = self.frame(TOP)
self.button(keyF, LEFT, '-', self.sign)
self.button(keyF, LEFT, '0', lambda ch='0': self.digit(ch))
self.button(keyF, LEFT, '.', self.decimal)
 
# The frame is used to hold the operator buttons.
opsF = self.frame(TOP)
for char in "+-*/=":
if char == '=':
btn = self.button(opsF, LEFT, char, self.calc)
else:
btn = self.button(opsF, LEFT, char,
lambda w=self, s=char: w.oper(s))
 
# Clear button.
clearF = self.frame(BOTTOM)
self.button(clearF, LEFT, 'Clr', lambda w=self.display: w.set(''))
 
# Make a new function for the - sign. Maybe for . Add event
# bindings for digits to call the button functions.
 
# This allows the file to be used either as a module or an independent
# program.
if __name__ == '__main__':
Calculator().mainloop()

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 22 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid