最佳解答者
Cannot publish VB.Net Windows application after Adding app.config

問題
-
Hi
I am not sure why I cannot publish the VB.Net Windows application, after I added an "Application Configuration File". But after I remove the app.config. I can publish the project again.
The location for the project that I publish is on a network drive E.g. \\ProjectServer\IT\MyUtility
I have been published that project quite a lot of time. I just do not understand why after adding a app.config file, it
It return an error message
"Error 1 Publish failed with the following error: Could not find a part of the path 'C:\Projects\VB\MyUtility\MyUtility\bin\Release\MyUtility.publish\MyUtility_1_0_0_19'."
Could you give me some advice, how could I add the app.config files?
Here it is the content of the app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<system.windows.forms jitDebugging="true" />
</configuration>
Many thanks
Chi2008年5月22日 上午 09:10
解答
-
I found a article here: http://msdn.microsoft.com/en-us/library/ms379560(VS.80).aspx ,which seems to be the problem you are having. I didn't try it out yet but may be you can quickly give it a try.
Quote:
Publish operation fails when invoked using the "Publish Now" or "Publish Wizard" buttons on the Publish tab of the project properties designer
After invoking publishing using either the Publish Now or Publish Wizard buttons, the publish operation will fail. The error can vary, for example: "Failed to copy file 'C:\..\setup.exe' to 'http://../setup.exe.' Unable to add 'setup.exe' to the Web. Unable to add file 'setup.exe.' The system cannot find the file specified," or "Publish failed with the following error: Could not find a part of the path 'C:\..\publish\..'"
Work Around:
- Close and reopen the project that is to be published.
- Right-click on the project in the solution explorer, and select Properties.
- In project designer, navigate to the Publish tab. Set properties there as appropriate.
- Right-click on the project in the solution explorer, and select Publish.
Note In general, avoid using the Publish Now or Publish Wizard buttons altogether. Use the Publish command in the context menu in the solution explorer or the Build top-level menu item.
2008年5月22日 上午 10:45
所有回覆
-
I found a article here: http://msdn.microsoft.com/en-us/library/ms379560(VS.80).aspx ,which seems to be the problem you are having. I didn't try it out yet but may be you can quickly give it a try.
Quote:
Publish operation fails when invoked using the "Publish Now" or "Publish Wizard" buttons on the Publish tab of the project properties designer
After invoking publishing using either the Publish Now or Publish Wizard buttons, the publish operation will fail. The error can vary, for example: "Failed to copy file 'C:\..\setup.exe' to 'http://../setup.exe.' Unable to add 'setup.exe' to the Web. Unable to add file 'setup.exe.' The system cannot find the file specified," or "Publish failed with the following error: Could not find a part of the path 'C:\..\publish\..'"
Work Around:
- Close and reopen the project that is to be published.
- Right-click on the project in the solution explorer, and select Properties.
- In project designer, navigate to the Publish tab. Set properties there as appropriate.
- Right-click on the project in the solution explorer, and select Publish.
Note In general, avoid using the Publish Now or Publish Wizard buttons altogether. Use the Publish command in the context menu in the solution explorer or the Build top-level menu item.
2008年5月22日 上午 10:45