|
I've been converting / writing a handful of apps using Visual Studio 2005 and publishing the files for ClickOnce upgrades.
When we wrote applications with VS2003 we setup app-config files and could change parameters in our apps by adjusting the app-config without recompiling.
Now with ClickOnce we publish to a location on our intranet and install the app on each local workstation. Where is the app-config. It seems like we now have to change the app-config in Visual Studio and re-publish. There should be a way to just go to the app-config at some central location to change parameters if needed?
I'm missing some piece of knowledge that hopefully somebody has.
Thanks for any help
Lost in the vast sea of .NET
|
|
|
|
|
Hey!
I am building on a simple chat application that uses callbacks. The contract are created in a class library that are then referd to in myWCFCallBackHost, the contract looks like this:
Contract:
<br />
namespace myWCFCallBackService<br />
{<br />
[ServiceContract(SessionMode=SessionMode.Required, CallbackContract = typeof(IChangedHandler))]<br />
public interface IChat<br />
{<br />
[OperationContract(IsOneWay=false, IsInitiating = true)]<br />
void Subscribe(string inName);<br />
<br />
[OperationContract(IsOneWay = false, IsTerminating = true)]<br />
void Unsubscribe();<br />
<br />
[OperationContract(IsOneWay = true)]<br />
void publishNewMessage(string inMessage, string inName);<br />
}<br />
<br />
public interface IChangedHandler<br />
{<br />
[OperationContract(IsOneWay = true)]<br />
void changed(string newMessage);<br />
}<br />
<br />
[ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)]<br />
public class chat : IChat<br />
{<br />
private List<IChangedHandler> mSubscribers = new List<IChangedHandler>();<br />
<br />
public chat()<br />
{<br />
<br />
}<br />
<br />
public void Subscribe(string inName)<br />
{<br />
mSubscribers.Add(OperationContext.Current.GetCallbackChannel<IChangedHandler>());<br />
}<br />
<br />
public void Unsubscribe()<br />
{<br />
IChangedHandler caller =<br />
OperationContext.Current.GetCallbackChannel<IChangedHandler>();<br />
<br />
foreach (IChangedHandler ch in mSubscribers)<br />
{<br />
if (ch == caller)<br />
{<br />
mSubscribers.Remove(ch);<br />
break;<br />
}<br />
}<br />
}<br />
public void publishNewMessage(string inMessage, string inName)<br />
{<br />
int nIndex = 0;<br />
try<br />
{<br />
foreach (IChangedHandler ch in mSubscribers)<br />
{<br />
ch.changed(inMessage);<br />
nIndex++;<br />
}<br />
}<br />
catch (Exception ex)<br />
{<br />
mSubscribers.RemoveAt(nIndex);<br />
}<br />
}<br />
}<br />
}<br />
HOST:
My Host for this class library is a windows application project(myWCFCallBackHost), the initialize method looks likes this:
<br />
private void initializeHost()<br />
{<br />
Uri addr;<br />
try<br />
{<br />
mChat = new chat();<br />
<br />
addr = new Uri(ConfigurationManager.AppSettings["baseTcpTempService"]);<br />
mServiceHost = new ServiceHost(mChat, addr);<br />
<br />
addr = new Uri(ConfigurationManager.AppSettings["basePipeTempService"]);<br />
mServiceHost.AddServiceEndpoint(typeof(myWCFCallBackService.IChat), new NetNamedPipeBinding(), addr);<br />
<br />
mServiceHost.Open();<br />
<br />
lstStatus.Items.Insert(0, DateTime.Now.ToString() + " - Chat server is running.");<br />
}<br />
catch(Exception ex)<br />
{<br />
MessageBox.Show("Error: " + ex.Message);<br />
}<br />
}<br />
The app.config file in my host project looks like this:
<br />
appSettings><br />
add key="baseTcpTempService" value="net.tcp://localhost:9000/chat" /><br />
add key="basePipeTempService" value="net.pipe://localhost/chat" /><br />
/appSettings><br />
system.serviceModel><br />
services><br />
service name="TempSensor"><br />
endpoint<br />
address=""<br />
binding="netTcpBinding"<br />
contract="ITempChangedPub"<br />
/><br />
/service><br />
/services><br />
/system.serviceModel><br />
PROBLEM
Generate proxy:
I have earlyer built a simple wcf application with one client and one host, i was here using http binding.
By using the fallowing command i could get a proxy class(cs) and a output.config(app.config) for the client:
svcutil.exe http://localhost/myService?wsdl
This workt grate, the client could contact the host with no problems.
But now when I am using TCP i need to run svcutil on my assembly(dll) file from my Service project(myWCFCallBackService) like this:
svcutil.exe myWCFCallBackService.dll
And this generates two files(xsd and wsdl). Now i need to run svcutil.exe on this two files as well, but this will not work?
svcutil.exe tempuri.org.wsdl
Gets me the fallowing error:
Error: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.Se
rviceModel.Description.DataContractSerializerMessageContractImporter
Error: Schema with target namespace 'http://tempuri.org/' could not be found.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/'
]/wsdl:portType[@name='IChat']
Error: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is de
pendent on.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org/
']/wsdl:portType[@name='IChat']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/'
]/wsdl:binding[@name='DefaultBinding_IChat']
Generating files...
Warning: No code was generated.
If you were trying to generate a client, this could be because the metadata docu
ments did not contain any valid contracts or services
or because all contracts/services were discovered to exist in /reference assembl
ies. Verify that you passed all the metadata documents to the tool.
Warning: If you would like to generate data contracts from schemas make sure to
use the /dataContractOnly option.
And if i run:
svcutil.exe tempuri.org.xsd
I get the fallowing error:
Generating files...
Warning: No code was generated.
If you were trying to generate a client, this could be because the metadata docu
ments did not contain any valid contracts or services
or because all contracts/services were discovered to exist in /reference assembl
ies. Verify that you passed all the metadata documents to the tool.
Warning: If you would like to generate data contracts from schemas make sure to
use the /dataContractOnly option.
I was expected a proxy class(cs) and a output.config file(app.config).
What am i doing wrong?
Other Questions
1. Am I handling the callback correct?
2. Will i get a proxy class and a config file from using svutil.exe or what will i get? and how to use them?
3. From a earlier project alot of things was placed in the Hosts app.config file insted of in the code, like this:
<br />
<?xml version="1.0" encoding="utf-8" ?><br />
<configuration><br />
<system.serviceModel><br />
<behaviors><br />
<serviceBehaviors><br />
<behavior name="myServiceTypeBehavior"><br />
<serviceMetadata httpGetEnabled="True"/><br />
</behavior><br />
</serviceBehaviors><br />
</behaviors><br />
<services><br />
<service name="myWCFServerObjectSender.personService" behaviorConfiguration="myServiceTypeBehavior"><br />
<endpoint address="http://localhost/person"<br />
binding="basicHttpBinding"<br />
contract="myWCFServerObjectSender.personService"><br />
</endpoint><br />
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" /><br />
</service><br />
</services><br />
</system.serviceModel><br />
</configuration><br />
Is it posible to do somthing like this with the current project? and if, how should it look like?.
Sorry for all the questions but i am learning the intressting WCF framework.
|
|
|
|
|
what are the classes present in the dotnet framework
|
|
|
|
|
Why do you ask?
There are thousands of classes in the framework. They are all present in the documentation. It would hardly be useful to just present a list of all the classes.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
|
what are the interfaces present in dotnet framework
|
|
|
|
|
Why do you ask?
I estimate that there are hundreds of interfaces in the framework. They are all present in the documentation. It would hardly be useful to just present a list of all the interfaces.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
|
|
Is it me or is the built in reporting in .NET a bit weak? At least when reporting out of an Access database.
I cannot for the life of me figure out how to filter for specific records in a report. I cam bind and a get a report that lists all the records but I cannot find a simple way to use data binding (without writing code that is) and just filter for the data that I want. Seems to me that unless I am willing to manually bind to a data set that I populate with my own query I am a bit stuck.
|
|
|
|
|
i have created a website but i am facing problem to create option "remember password on same computer"
if anyone have idea or code to use the same option please send me.
thank you!!!
contact me: ashish.0619@gmail.com
|
|
|
|
|
|
|
|
Hi,
i wanna use ftpconnection for upload a file from another pc(T) in interanet,so i
use
FtpConnection1.Connect()
FtpConnection1.UploadFile("C:\Documents and Settings\Mypc\My Documents\xmlfolder\xmlMetaData232a1ffd-c657-475c-b38d-ae3a898533fc.xml", "ftp://T/test1/")
but in this line i take a error with this message:
is there anybody that can help me
regards Maryam Gharibi
|
|
|
|
|
hi,
What is the difference b/w Manifest & metadata?
thanks
rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Every managed module will have metadata, which tells about type, methods etc.
an assembly in a collection of one or more managed modules, in which one of the module's meteadata will contain the manifest for the assembly,
manifest contains information about assembly, version, public key, culture, other assembly this refers to , info about all the module ..
|
|
|
|
|
After manipulating long strings (as, for example, entered by a user in textarea) and saving to text file, I am having problems with ! characters appearing all by themselves in the middle.... I know I've read something about this somewhere, but can't find reference to it now. Has anyone else experienced this, and know what to do about it?
cheers
Fred
|
|
|
|
|
Unknown phenomenon.
Please expand (what is long?), show code, send data file, ...
Luc Pattyn
|
|
|
|
|
So I found that an internal list we wrapped with a public ReadOnlyCollection's members are still editable outside the class, through the ReadOnlyCollection. Maybe I am missing the point, is it simply the ReadOnlyCollection itself that is uneditable and not necessarily the members of the ReadOnlyCollection? What would be the point if this is true? Thanks for your help,
David Troyer
|
|
|
|
|
can u pls elaborate your question with some code snippets?
|
|
|
|
|
Is there a way to take away the arrow shown on a shortcut for a single application without altering the registry that affects all applications?
Thank-you for everybody's assistance.
|
|
|
|
|
On a shortcut icon? No, there isn't. That little arrow will show up on any icon you give to a shortcut.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
After I have read several articles on msdn and other tech sites, I am now bogged now with a doubt.
Is CTS a specification checked by CLR or a component in CLR?
I read all about the goals of CTS. But inside the .NET framework how it is placed?
Is it defined as a set of rules inside CLR, hence can I take it is a component ?
Or is the CLR programmed to check the some specifications( which we call CTS) while executing a CLR compliant language?
Please explain me to get more insight in to this.
Thanks,
mani
|
|
|
|
|
The Common Type System is just a set of rules that defines a commonly used set of primitive types, like System.Int32 , that are used by all languages that the Common Language Runtime supports. These type are mapped to the types used in each language. For example, System.Int32 is an int in C# and an Interger in VB.NET. This makes it very easy for classes written in different languages to pass data back and forth without any custom, time-consuming, conversions.
The CTS is a set of rules, or specifications, at the core of the CLR, not a module or a component. It's part of the Common Language Specification that every .NET compiler MUST adhere to to manitain compatibility with the .NET Framework.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|