Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,


I have confi settings in my application

XML
<?xml version="1.0"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    <requiredRuntime version="v4.0.20506" />
  </startup>
</configuration>





i want to deploy my exe without confi file.


thanks
Posted
Comments
Prashant. B. Chavan 6-Aug-14 3:21am    
Have you tried running application without confi file? Does it shown some runtime error?

I think exe should work confi file.
nikita2410 6-Aug-14 3:58am    
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
Prashant. B. Chavan 6-Aug-14 7:09am    
Can you post error description? I tried same config file with same XML data and it works without <appname>.exe.config file.
nikita2410 7-Aug-14 0:50am    
I have a dll which uses v2.0.50727 which i want to include in version 4. So i created the above mentioned confi file.
But if i run the exe withour app.exe.config then it doesnt load the dll.
Prashant. B. Chavan 7-Aug-14 11:01am    
I replicated the scenario exactly same way you explained. But, it worked for me without .config file. Please post error snap or description.

1 solution

Refer - ClickOnce configuration deployment - configuration files[^]
Quote:
The config file should get published automatically; if not, ensure that it is configured to copy to output, and (if that fails) check the publish files (project properties -> publish -> application files; the config file should be marked as "include (auto)" or "include").

You shouldn't attempt to update anything in the app install directory. That is a bad idea generally (since you can't assume you can update "program files" unless you're an admin), but the same holds true for ClickOnce too.

Just create a settings file with some user settings; these will be saved in the user's profile, so can be updated reliably. You can't edit the files deployed via ClickOnce; even if you had access, it would (by default) break the hashing function, and it will refuse to load them. You can turn off the hashing, but... this still isn't a great idea.
 
Share this answer
 
Comments
nikita2410 6-Aug-14 4:36am    
i am still getting the same error
Delete the requiredRuntime inside the startup and see if it works or not.
nikita2410 7-Aug-14 0:50am    
Nope.. its not working

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900